Help us understand the problem. What is going on with this article?

Kubernetes Meetup Tokyo #16 デモ

More than 1 year has passed since last update.

2019/02/19に行われたKubernetes Meetup Tokyo #16でデモをしたのでその解説記事です。発表スライドはこちら

準備

CNIプラグインとのやりとりを模擬してくれるツールcnitoolを導入します。またデモで使用したスクリプトの中でjqコマンドを使うのでそちらも導入します。

go get github.com/containernetworking/cni/cnitool
sudo apt install jq

次にデモで使用するnetwork namespaceを準備します。

sudo ip netns add testing

デモで使ったスクリプトとコンフィグを取ってきます。

git clone https://github.com/hichihara/cnisample
cd cnisample

ptp デモ

発表ではptpのデモをはじめに見せましたが、こちらは公式のREADMEを見てもらった方が早いのでそちらを参照してください。

echo デモ

特に何もしないプラグイン。

ADD

sudo CNI_PATH=./k8sjp_demo NETCONFPATH=./k8sjp_demo/conf cnitool add myecho /var/run/netns/testing

mysample

与えられたPodにvethを付けてIPアドレスを割り当てホストとの通信を確立するプラグイン。

ADD

sudo CNI_PATH=./k8sjp_demo NETCONFPATH=./k8sjp_demo/conf cnitool add mysample /var/run/netns/testing

疎通確認

ping -c 1 172.16.29.2

DEL

sudo CNI_PATH=./k8sjp_demo NETCONFPATH=./k8sjp_demo/conf cnitool del mysample /var/run/netns/testing

mysample-chain

mysampleで作成したインターフェース情報を取得し、Podからホストの外への通信を確立するプラグイン。

ADD

sudo CNI_PATH=./k8sjp_demo NETCONFPATH=./k8sjp_demo/conf cnitool add mysample-chain /var/run/netns/testing

疎通確認

sudo ip netns exec testing ping -c 1 8.8.8.8

DEL

sudo CNI_PATH=./k8sjp_demo NETCONFPATH=./k8sjp_demo/conf cnitool del mysample-chain /var/run/netns/testing

後片付け

使い終わったnetwork namespaceを削除します。

sudo ip netns del testing
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした