Skip to content

Commit

Permalink
netns: move configuration under agent.topology.netns
Browse files Browse the repository at this point in the history
  • Loading branch information
lebauce committed Apr 8, 2019
1 parent c740e58 commit 04fa6d4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var (
"agent.auth.cluster.password": {"auth.analyzer_password"},
"agent.auth.cluster.username": {"auth.analyzer_username"},
"agent.capture.stats_update": {"agent.flow.stats_update"},
"agent.topology.netns.run_path": {"netns.run_path"},
"analyzer.auth.api.backend": {"auth.type"},
"analyzer.auth.cluster.backend": {"auth.type"},
"analyzer.auth.cluster.password": {"auth.analyzer_password"},
Expand Down Expand Up @@ -78,6 +79,7 @@ func init() {
cfg.SetDefault("agent.topology.probes", []string{"ovsdb"})
cfg.SetDefault("agent.topology.libvirt.url", "qemu:///system")
cfg.SetDefault("agent.topology.netlink.metrics_update", 30)
cfg.SetDefault("agent.topology.netns.run_path", "/var/run/netns")
cfg.SetDefault("agent.topology.neutron.domain_name", "Default")
cfg.SetDefault("agent.topology.neutron.endpoint_type", "public")
cfg.SetDefault("agent.topology.neutron.ssl_insecure", false)
Expand Down Expand Up @@ -139,8 +141,6 @@ func init() {
cfg.SetDefault("logging.level", "INFO")
cfg.SetDefault("logging.syslog.tag", "skydive")

cfg.SetDefault("netns.run_path", "/var/run/netns")

cfg.SetDefault("opencontrail.host", "localhost")
cfg.SetDefault("opencontrail.mpls_udp_port", 51234)
cfg.SetDefault("opencontrail.port", 8085)
Expand Down
2 changes: 1 addition & 1 deletion contrib/ansible/roles/skydive_agent/tasks/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{% endif %}
-v /var/run/netns:/host/run:ro,shared \
-v /etc/skydive/skydive.yml:/etc/skydive.yml \
-e SKYDIVE_NETNS_RUN_PATH=/host/run {{ skydive_agent_docker_extra_env }} \
-e SKYDIVE_AGENT_TOPOLOGY_NETNS_RUN_PATH=/host/run {{ skydive_agent_docker_extra_env }} \
-p {{ skydive_agent_port }}:{{ skydive_agent_port }} \
--name=skydive-agent-{{ ansible_hostname }} \
{{ skydive_docker_registry }}/{{ skydive_agent_docker_image }}:{{ skydive_agent_docker_image_tag or skydive_docker_image_tag }} \
Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
- /var/run/netns:/host/run:shared
- /var/run/openvswitch/db.sock:/var/run/openvswitch/db.sock
environment:
- SKYDIVE_NETNS_RUN_PATH=/host/run
- SKYDIVE_AGENT_TOPOLOGY_NETNS_RUN_PATH=/host/run
- SKYDIVE_ANALYZERS=127.0.0.1:8082

networks:
Expand Down
4 changes: 4 additions & 0 deletions etc/skydive.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ agent:
# delay in seconds between two metric updates
# metrics_update: 30

netns:
# allow to specify where the netns probe is watching network namespace
# run_path: /var/run/netns

# Define OpenStack Neutron credentials and the enpoint type
# used by the neutron probe
neutron:
Expand Down
4 changes: 2 additions & 2 deletions scripts/scale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ agent:
- netns
- ovsdb
- socketinfo
netns:
run_path: $TEMP_DIR/$NAME-netns
auth:
cluster:
username: agent-${IDX}
Expand All @@ -210,8 +212,6 @@ flow:
expire: 600
update: 5
protocol: $FLOW_PROTOCOL
netns:
run_path: $TEMP_DIR/$NAME-netns
etcd:
data_dir: $TEMP_DIR/$NAME-etcd
servers:
Expand Down
2 changes: 1 addition & 1 deletion topology/probes/netns/netns.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func NewProbe(g *graph.Graph, n *graph.Node, nlProbe *netlink.Probe) (*Probe, er
state: common.StoppedState,
}

if path := config.GetString("netns.run_path"); path != "" {
if path := config.GetString("agent.topology.netns.run_path"); path != "" {
nsProbe.Watch(path)
}

Expand Down

0 comments on commit 04fa6d4

Please sign in to comment.