Skip to content
Snippets Groups Projects
Unverified Commit d20ed472 authored by OpenShift Merge Robot's avatar OpenShift Merge Robot Committed by GitHub
Browse files

Merge pull request #48 from rhatdan/master

Improve documentation of use with Podman
parents 19b5b1c1 dd26e9e5
No related branches found
No related tags found
No related merge requests found
...@@ -17,25 +17,49 @@ Using your package manager, install the *dnsmasq* package. For Fedora, this wou ...@@ -17,25 +17,49 @@ Using your package manager, install the *dnsmasq* package. For Fedora, this wou
## Build and install ## Build and install
1. using git, clone the *github.com/containers/dnsname* repository. 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 2. make install PREFIX=/usr -- this will install the dnsname plugin into /usr/libexec/cni where
should already exist. your CNI plugins should already exist.
## Configure a CNI network for Podman ## Configure a CNI network for Podman
1. Create a new network using `podman network create`. For example, `podman network create foobar` will suffice. 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 ## Example: container name resolution
1. sudo podman run -dt --name web --network foobar quay.io/libpod/alpine_nginx:latest In this test image, the nginx server will
5139d65d22135e9ecab511559d863754550894a32285befd94dab231017048c2 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 ```console
*podman rulez* on an http request. sudo podman run -dt --name web --network foobar quay.io/libpod/alpine_nginx:latest
2. sudo podman run -it --name client --network cni-podman1 quay.io/libpod/alpine_nginx:latest curl http://web/ 5139d65d22135e9ecab511559d863754550894a32285befd94dab231017048c2
podman rulez
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 ## 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 After making sure the *dnsplugin* is functioning properly, you can add name resolution to your default Podman
......
{
"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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment