LoginSignup
0
1

More than 5 years have passed since last update.

GKE+Container-Optimized OS+NFS環境で、共有ストレージに置いたスクリプトを実行すると hang する

Posted at

環境

  • GKE クラスタ
  • ノードイメージは COS(Container-Optimized OS)
  • Pod では 別途用意した NFS 共有ストレージをマウント(NFS バージョンは任意)

検証

Apache+Perl 実行環境 と NFS をマウントするよう設定した Pod にログインして検証

[root@<Pod Name> /]# df -h
・・・
10.1.0.6:/       40G   48M   38G   1% /var/www/cgi-bin
・・・

[root@<Pod Name> /]# ls -l /var/www/cgi-bin
total 8
-rwx---r-x 1 root root 247 Oct 16 17:02 index.cgi
-rwxr-xr-x 1 root root  33 Oct 16 17:51 test.sh

[root@<Pod Name> /]# /var/www/cgi-bin/test.sh
(hang)

[root@<Pod Name> /]# curl http://localhost/cgi-bin/index.cgi
(hang & Timeout)

対策

公式にあるノードイメージのページに、次のように書かれていた。

Ubuntu

Ubuntu ノードイメージは、Kubernetes Engine のノードイメージ要件に照らして検証されています。ノードで NFS、glusterfs、Sysdig、または Debian パッケージをサポートする必要がある場合は、Ubuntu ノードイメージを使用してください。サポートが終了した container-vm ノードイメージは Ubuntu イメージに置き換えられます。

再検証

ノードイメージを Ubuntu に変更すると再現しなくなった。

[root@<Pod Name> /]# df -h
・・・
10.1.0.6:/       40G   48M   38G   1% /var/www/cgi-bin
・・・

[root@<Pod Name> /]# ls -l /var/www/cgi-bin
total 8
-rwx---r-x 1 root root 247 Oct 16 17:02 index.cgi
-rwxr-xr-x 1 root root  33 Oct 16 17:51 test.sh

[root@<Pod Name> /]# /var/www/cgi-bin/test.sh
Hello World!

[root@<Pod Name> /]# curl http://localhost/cgi-bin/index.cgi
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
CGI Test Page
</div>
</body>
</html>

参考情報

https://github.com/kubernetes/examples/issues/249
https://cloud.google.com/kubernetes-engine/docs/node-images?hl=ja#ubuntu

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1