diff --git a/README_PODMAN.md b/README_PODMAN.md index 8709f9e463286ae77502a73322309383ff78dbef..43b35b7bc449ce0f734ce7260162485fdff15d57 100644 --- a/README_PODMAN.md +++ b/README_PODMAN.md @@ -17,25 +17,49 @@ Using your package manager, install the *dnsmasq* package. For Fedora, this wou ## Build and install 1. using git, clone the *github.com/containers/dnsname* repository. -2. make install PREFIX=/usr -- this will install the dnsname plugin into /usr/libexec/cni where your CNI plugins -should already exist. +2. make install PREFIX=/usr -- this will install the dnsname plugin into /usr/libexec/cni where +your CNI plugins should already exist. ## Configure a CNI network for Podman 1. Create a new network using `podman network create`. For example, `podman network create foobar` will suffice. -The following example [configuration file](example/cni-podman1.conflist) shows a usable example for Podman. +The following example [configuration file](example/foobar.conflist) shows a usable example for Podman. + +2. (optional)+The configuration will be automatically enabled for newly created networks via +`podman network create`. If you want to add this feature to an exisiting network add the needed +lines to `/etc/cni/net.d/foobar.conflist` using your favorite editor. For example: + + ``` +{ + "cniVersion": "0.4.0", + "name": "foobar", + "plugins": [ + ... + { + "type": "dnsname", + "domainName": "dns.podman" + "capabilities": { + "aliases": true + } + } + ] +} + ``` ## Example: container name resolution -1. sudo podman run -dt --name web --network foobar quay.io/libpod/alpine_nginx:latest - 5139d65d22135e9ecab511559d863754550894a32285befd94dab231017048c2 +In this test image, the nginx server will +respond with *podman rulez* on an http request. +**Note**: we use the --network foobar here. - Note: we use the --network foobar here. Also, in this test image, the nginx server will respond with - *podman rulez* on an http request. -2. sudo podman run -it --name client --network cni-podman1 quay.io/libpod/alpine_nginx:latest curl http://web/ -podman rulez +```console +sudo podman run -dt --name web --network foobar quay.io/libpod/alpine_nginx:latest +5139d65d22135e9ecab511559d863754550894a32285befd94dab231017048c2 +sudo podman run -it --name client --network foobar quay.io/libpod/alpine_nginx:latest curl http://web/ +podman rulez +``` ## Enabling name resolution on the default Podman network After making sure the *dnsplugin* is functioning properly, you can add name resolution to your default Podman diff --git a/example/foobar.conflist b/example/foobar.conflist new file mode 100644 index 0000000000000000000000000000000000000000..d13880eafd7b6fbf91038d51c78f6cd6d01bf023 --- /dev/null +++ b/example/foobar.conflist @@ -0,0 +1,48 @@ +{ + "cniVersion": "0.4.0", + "name": "foobar", + "plugins": [ + { + "type": "bridge", + "bridge": "cni-podman1", + "isGateway": true, + "ipMasq": true, + "hairpinMode": true, + "ipam": { + "type": "host-local", + "routes": [ + { + "dst": "0.0.0.0/0" + } + ], + "ranges": [ + [ + { + "subnet": "10.89.0.0/24" + } + ] + ] + } + }, + { + "type": "portmap", + "capabilities": { + "portMappings": true + } + }, + { + "type": "firewall", + "backend": "" + }, + { + "type": "tuning" + }, + { + "type": "dnsname", + "domainName": "dns.podman", + "capabilities": { + "aliases": true + } + } + ] +} \ No newline at end of file