Merge ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:wrapper into ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:master

Proposed by Barry Price
Status: Superseded
Proposed branch: ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:wrapper
Merge into: ~barryprice/charm-k8s-bind/+git/charm-k8s-bind:master
Diff against target: 245 lines (+42/-67)
7 files modified
.jujuignore (+1/-0)
Makefile (+3/-3)
README.md (+23/-54)
dockerfile (+1/-2)
image-scripts/docker-wrapper.sh (+2/-0)
metadata.yaml (+7/-3)
tests/unit/test_charm.py (+5/-5)
Reviewer Review Type Date Requested Status
Barry Price Pending
Review via email: mp+402963@code.launchpad.net

Commit message

Convert from using both ENTRYPOINT and CMD to a single wrapper script that sets up our config and then starts the bind service

To post a comment you must log in.
287bc61... by Barry Price

Repoint shellcheck to renamed file

Unmerged commits

287bc61... by Barry Price

Repoint shellcheck to renamed file

2341d51... by Barry Price

Convert from using both ENTRYPOINT and CMD to a single wrapper script that sets up our config and then starts the bind service

062a222... by Tom Haddon

Rename charm for consistency with others

Reviewed-on: https://code.launchpad.net/~mthaddon/charm-k8s-bind/+git/charm-k8s-bind/+merge/402883
Reviewed-by: Barry Price <email address hidden>

a2bf1f0... by Tom Haddon

Update README for new charm name

5f5b4f4... by Tom Haddon

Rename charm for consistency with others

0a8dd26... by Tom Haddon

Update README and metadata.yaml to be more end-user focused

Reviewed-on: https://code.launchpad.net/~mthaddon/charm-k8s-bind/+git/charm-k8s-bind/+merge/395302
Reviewed-by: Laurent Sesques <email address hidden>

3adff97... by Tom Haddon

Update README and metadata.yaml to be more end-user focused

89e8f48... by Tom Haddon

Remove unnecessary reference to config.yaml in README

Reviewed-on: https://code.launchpad.net/~mthaddon/charm-k8s-bind/+git/charm-k8s-bind/+merge/395069
Reviewed-by: Laurent Sesques <email address hidden>

ac4ab68... by Tom Haddon

Remove unnecessary reference to config.yaml in README

ff88d40... by Barry Price

Clean up docs, and explain how to work around the recursion default

Reviewed-on: https://code.launchpad.net/~barryprice/charm-k8s-bind/+git/charm-k8s-bind/+merge/393440
Reviewed-by: Benjamin Allot <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.jujuignore b/.jujuignore
2index e8eb682..128851d 100644
3--- a/.jujuignore
4+++ b/.jujuignore
5@@ -1,4 +1,5 @@
6 *~
7+*.charm
8 .coverage
9 .gitignore
10 __pycache__
11diff --git a/Makefile b/Makefile
12index 6e99731..564aeb9 100644
13--- a/Makefile
14+++ b/Makefile
15@@ -12,7 +12,7 @@ lint: blacken
16
17 # We actually use the build directory created by charmcraft,
18 # but the .charm file makes a much more convenient sentinel.
19-unittest: bind.charm
20+unittest: bind-k8s.charm
21 @tox -e unit
22
23 test: lint unittest
24@@ -21,7 +21,7 @@ clean:
25 @echo "Cleaning files"
26 @git clean -fXd
27
28-bind.charm: src/*.py requirements.txt
29+bind-k8s.charm: src/*.py requirements.txt
30 charmcraft build
31
32 image-deps:
33@@ -30,7 +30,7 @@ image-deps:
34
35 image-lint: image-deps
36 @echo "Running shellcheck."
37- @shellcheck image-scripts/docker-entrypoint.sh
38+ @shellcheck image-scripts/docker-wrapper.sh
39 @shellcheck image-scripts/dns-check.sh
40
41 image-build: image-lint
42diff --git a/README.md b/README.md
43index c0b037d..3e31d97 100644
44--- a/README.md
45+++ b/README.md
46@@ -1,74 +1,37 @@
47-# Bind charm
48+# Bind Operator
49
50 A Juju charm deploying Bind, configurable to use a git repository for its configuration files.
51
52 ## Overview
53
54-This is a k8s workload charm and can only be deployed to a Juju k8s cloud,
55-attached to a controller using `juju add-k8s`.
56+BIND 9 has evolved to be a very flexible, full-featured DNS system. Whatever
57+your application is, BIND 9 probably has the required features. As the first,
58+oldest, and most commonly deployed solution, there are more network engineers
59+who are already familiar with BIND 9 than with any other system.
60
61-This charm is not currently ready for production due to issues with providing
62-an egress to route TCP and UDP traffic to the pods. See:
63+## Usage
64
65-https://bugs.launchpad.net/charm-k8s-bind/+bug/1889746
66-
67-https://bugs.launchpad.net/juju/+bug/1889703
68-
69-## Details
70-
71-See config option descriptions in config.yaml.
72-
73-## Getting Started
74-
75-Notes for deploying a test setup locally using microk8s, the setup of which is
76-documented here: https://juju.is/docs/microk8s-cloud
77+For details on using Kubernetes with Juju [see here](https://juju.is/docs/kubernetes), and for
78+details on using Juju with MicroK8s for easy local testing [see here](https://juju.is/docs/microk8s-cloud).
79
80+To deploy this charm in a juju k8s model:
81 ```
82-juju add-model bind-test
83+juju deploy bind-k8s
84 ```
85-
86-1. Either deploy with the default image from Dockerhub:
87-
88-```
89-juju deploy cs:~bind-charmers/bind
90-```
91-2. Or optionally build your own image locally and deploy with that
92-
93-```
94-sudo snap install charmcraft
95-git clone https://git.launchpad.net/charm-k8s-bind
96-cd charm-k8s-bind
97-make image-build
98-docker push localhost:32000/bind
99-juju deploy cs:~bind-charmers/bind --config bind_image_path=localhost:32000/bind:latest bind
100-
101-juju wait
102-juju status
103-```
104-
105-Assuming you're using the image from dockerhub, or an image built locally from
106-this repo without changes, the charm will deploy bind with its stock Ubuntu
107-package configuration, which will forward all queries to root name servers.
108+The charm will deploy bind with its stock Ubuntu package configuration, which
109+will forward all queries to root name servers.
110
111 DNSSEC is also enabled by default.
112
113 Custom config can be deployed by setting the `custom_config_repo` option to
114 point to a Git repository containing a valid set of configuration files with
115-which to populate the /etc/bind/ directory within the pod(s).
116+which to populate the `/etc/bind/` directory within the pod(s).
117
118 Since bind won't allow recursion from external clients by default, to allow
119-easy testing, I've set up a repo with a copy of the stock config, modified to
120-allow recursion from all RFC1918 networks:
121-
122-https://code.launchpad.net/~barryprice/junk/+git/etc-bind-stock-config-with-all-rfc1918-nets-allowed
123-
124-To configure a local microk8s-deployed bind application to use this config,
125-simply run:
126-
127+easy testing, you can use [a repo with a copy of the stock config, modified to allow recursion from all RFC1918 networks](https://code.launchpad.net/~barryprice/junk/+git/etc-bind-stock-config-with-all-rfc1918-nets-allowed):
128 ```
129-juju config bind custom_config_repo=https://git.launchpad.net/~barryprice/junk/+git/etc-bind-stock-config-with-all-rfc1918-nets-allowed
130+juju config bind-k8s custom_config_repo=https://git.launchpad.net/~barryprice/junk/+git/etc-bind-stock-config-with-all-rfc1918-nets-allowed
131 ```
132-
133 Once the application is ready, you should be able to query the App's IP address
134 (not the Unit addresses) directly from your local machine:
135
136@@ -81,10 +44,16 @@ bind-test myk8s-localhost myk8s/localhost 2.8.6 unsupported 16:44:30+07:0
137 App Version Status Scale Charm Store Rev OS Address Notes
138 bind bind:edge active 1 bind jujucharms 2 kubernetes 10.152.183.246
139
140-Unit Workload Agent Address Ports Message
141-bind/0* active idle 10.1.25.35 53/TCP,53/UDP Pod configured
142+Unit Workload Agent Address Ports Message
143+bind-k8s/0* active idle 10.1.25.35 53/TCP,53/UDP Pod configured
144
145 $ dig +short example.com @10.152.183.246
146 93.184.216.34
147 $
148 ```
149+
150+## Known Issues
151+
152+This charm is unable to provide an ingress to route TCP and UDP traffic to the
153+pods due to [LP#1889703](https://bugs.launchpad.net/juju/+bug/1889703). This is
154+also being tracked as [a bug against the charm itself](https://bugs.launchpad.net/charm-k8s-bind/+bug/1889746).
155diff --git a/dockerfile b/dockerfile
156index 968d4fd..4215462 100644
157--- a/dockerfile
158+++ b/dockerfile
159@@ -29,5 +29,4 @@ RUN chmod 0755 /usr/local/bin/dns-check.sh
160 EXPOSE 53/udp
161 EXPOSE 53/tcp
162
163-ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
164-CMD /usr/sbin/named -g -u bind -c /etc/bind/named.conf
165+CMD ["/usr/local/bin/docker-wrapper.sh"]
166diff --git a/image-scripts/docker-entrypoint.sh b/image-scripts/docker-wrapper.sh
167similarity index 97%
168rename from image-scripts/docker-entrypoint.sh
169rename to image-scripts/docker-wrapper.sh
170index 2ed0857..4f807e1 100644
171--- a/image-scripts/docker-entrypoint.sh
172+++ b/image-scripts/docker-wrapper.sh
173@@ -21,3 +21,5 @@ if [ -d "${BIND_CONFDIR}" ]; then
174 else
175 echo "Something went wrong, ${BIND_CONFDIR} does not exist, not starting";
176 fi
177+
178+/usr/sbin/named -g -u bind -c /etc/bind/named.conf
179diff --git a/metadata.yaml b/metadata.yaml
180index 12075b3..6c09e29 100644
181--- a/metadata.yaml
182+++ b/metadata.yaml
183@@ -1,6 +1,10 @@
184-name: "bind"
185-summary: "Bind"
186-description: "The original, complete open source DNS implementation"
187+name: bind-k8s
188+display-name: Bind
189+summary: The original, complete open source DNS implementation.
190+docs: https://discourse.charmhub.io/t/bind-documentation-overview/3973
191+description: |
192+ The original, complete open source DNS implementation.
193+ https://www.isc.org/bind/
194 min-juju-version: 2.8.0
195 maintainers:
196 - https://launchpad.net/~bind-charmers <bind-charmers@lists.launchpad.net>
197diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py
198index 85fe103..3938f12 100644
199--- a/tests/unit/test_charm.py
200+++ b/tests/unit/test_charm.py
201@@ -117,7 +117,7 @@ class TestBindK8s(unittest.TestCase):
202 'version': 2,
203 'containers': [
204 {
205- 'name': 'bind',
206+ 'name': 'bind-k8s',
207 'imageDetails': {'imagePath': 'example.com/bind:v1'},
208 'ports': [
209 {'containerPort': 53, 'name': 'domain-tcp', 'protocol': 'TCP'},
210@@ -137,7 +137,7 @@ class TestBindK8s(unittest.TestCase):
211 'version': 2,
212 'containers': [
213 {
214- 'name': 'bind',
215+ 'name': 'bind-k8s',
216 'imageDetails': {
217 'imagePath': 'secure.example.com/bind:v1',
218 'username': 'test-user',
219@@ -161,7 +161,7 @@ class TestBindK8s(unittest.TestCase):
220 'version': 2,
221 'containers': [
222 {
223- 'name': 'bind',
224+ 'name': 'bind-k8s',
225 'imageDetails': {'imagePath': 'example.com/bind:v1'},
226 'ports': [
227 {'containerPort': 53, 'name': 'domain-tcp', 'protocol': 'TCP'},
228@@ -181,7 +181,7 @@ class TestBindK8s(unittest.TestCase):
229 'version': 2,
230 'containers': [
231 {
232- 'name': 'bind',
233+ 'name': 'bind-k8s',
234 'imageDetails': {'imagePath': 'example.com/bind:v1'},
235 'ports': [
236 {'containerPort': 53, 'name': 'domain-tcp', 'protocol': 'TCP'},
237@@ -201,7 +201,7 @@ class TestBindK8s(unittest.TestCase):
238 'version': 2,
239 'containers': [
240 {
241- 'name': 'bind',
242+ 'name': 'bind-k8s',
243 'imageDetails': {'imagePath': 'example.com/bind:v1'},
244 'ports': [
245 {'containerPort': 53, 'name': 'domain-tcp', 'protocol': 'TCP'},

Subscribers

People subscribed via source and target branches

to all changes: