Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dnsname
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrors
dnsname
Commits
c173653d
Commit
c173653d
authored
5 years ago
by
baude
Browse files
Options
Downloads
Patches
Plain Diff
add podman minitutorial
Signed-off-by:
baude
<
bbaude@redhat.com
>
parent
5681c8c8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+4
-0
4 additions, 0 deletions
README.md
README_PODMAN.md
+55
-0
55 additions, 0 deletions
README_PODMAN.md
with
59 additions
and
0 deletions
README.md
+
4
−
0
View file @
c173653d
...
...
@@ -7,6 +7,10 @@ the pod and its IP address are added to a network specific hosts file that dnsma
is removed from the network, it will remove the entry from the hosts file. Each CNI network will have its own dnsmasq
instance.
The
*dnsplugin*
plugin was specifically designed for the
[
Podman
](
https://github.com/containers/libpod
)
container engine.
Follow the
[
mini-tutorial
](
README_PODMAN.md
)
to use it with Podman.:w
## Usage
The dnsname plugin can be enabled in the cni network configuration file.
...
...
This diff is collapsed.
Click to expand it.
README_PODMAN.md
0 → 100644
+
55
−
0
View file @
c173653d
# Using the dnsname plugin with Podman
The
*dnsname*
plugin allows containers to resolve each other by name. The plugin adds each
container's name to an instance of a dnsmasq server. The plugin is enabled through adding it to a network's
CNI configuration. The containers will only be able to resolve each other if they are on the same CNI network.
**Note**
: This plugin does not work with rootless containers.
This tutorial assumes you already have Podman, containernetwork-plugins, and a golang development environment installed.
## Install dnsmasq
Using your package manager, install the
*dnsmasq*
package. For Fedora, this would be:
`sudo dnf install dnsmasq`
## 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.
## Configure a CNI network for Podman
1.
Create a new network using
`podman network create`
. For example,
`podman network create foobar`
will suffice.
2.
Using your favorite editor, edit
`/etc/cni/net.d/foobar.conflist`
and add the following with the plugins stanza:
```
{
"type": "dnsname",
"domainName": "podman.io"
}
```
The following example
[
configuration file
](
example/cni-podman1.conflist
)
shows a usable example for Podman.
## Example: container name resolution
1.
sudo podman run -dt --name web --network foobar quay.io/libpod/alpine_nginx:latest
5139d65d22135e9ecab511559d863754550894a32285befd94dab231017048c2
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
## 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
network. This can be done two different ways:
1.
Add the
*dnsname*
plugin as described in above to your default Podman network. This default network is
usually
`/etc/cni/net.d/87-podman-bridge.conflist`
.
2.
Add a new network as described above and then edit
`/etc/containers/libpod.conf`
and change the
`cni_default_network`
key to your network name.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment