emacs on WSLã§Super/Hyperãã¼ã使ãæ¹æ³
ã¯ããã«
ãã®åã®æ±äº¬Emacsåå¼·ä¼ã§éè«ãã¦ãã¨ãã«ãSuperãã¼ãHyperãã¼ã®è©±ã«ãªããMacã¯ä¿®é£¾ãã¼ãå¤ãã¦ãããã¾ããã£ãã ãã¼ãã¤ã³ãè¦ããããã¨ãããã¾ã£ã¦ãã¦ã追å ã§æ©ãç¶æ³ã§ããããã
ã¨ãããã¨ã§èªåãSuper/Hyperããã¥ã¼ãã¹ããWSLã§ã®ããããã調ã¹ã¦ã¿ãã
ç°å¢
- wsl
- wslä¸ã§åãEmacs
- X410 (Xãµã¼ã)
ãªã®ã§ãemacs for windowsã¨ããmingwã®emacsã§ã¯ãªãã§ãããã®å ´åã¯ãã¾ãä»ã®æ段ãåãå¿ è¦ãããã¯ã 1ã
ãªããwslã§ä½¿ãXãµã¼ãã¨ããã°ãxmingãvcxsrvãæåã§ãããemacsã¨ã®ç¸æ§ããããªã(â»)ã®ã§å¥ã®æåã®Xãµã¼ãã使ã£ã¦ãã X410ã¯ãã¹ãã¢ã¢ããªã¨ãã¦è³¼å ¥ã§ããããããã£ã¡ã ã80%Offã»ã¼ã«ãã¦ããã®ã§å²å¼ã¿ã¤ãã³ã°ãçãã¾ãããã
(â») emacsã¨ã®ç¸æ§ããããåé¡ã«ã¤ãã¦ã¯ä»¥ä¸ã®ã¹ã©ã¤ãã
ç®æãã´ã¼ã«
ç¡å¤æãã¼ãSuperãã¼ã¨ãã¦ãå¤æãã¼ãHyperãã¼ã¨ãã¦ä½¿ããããã«ããã
ä¸è¬çã«ã¯ãWindowsãã¼ãSuperãã¼ã«ãããã¨æããããªããªãè¨å®ãªãã§ãããåãã¦ãããã¹ããªã®ã ãã©ãããããOSå´ã«ãã©ããããã¦ã¢ããªã±ã¼ã·ã§ã³ã¾ã§ãã¾ãå±ããªãã£ãã®ã¨ãWindows10ã«ãªã£ã¦Win+âã®ã·ã§ã¼ãã«ãããã¼ãå¢ãã¦ãããç¡å¹ã«ããã®ãä¸ä¾¿ã ã£ãã®ã§ãä¸è¨ã®è¨å®ããããªããã¨ã«ããã
åç½®ãã¯ä»¥ä¸ã
Superãã¼/Hyperãã¼ãè¨å®ãã
æ段ãã®1 AutoHotKeyã使ã
å¤åãããä¸çªæ©ãã¨æãã¾ãã ãµã³ãã«ãå¤ãã¯ãã
èªåã¯ããªãã¨ãªãWindowsã®ã¦ã¼ã¶ã©ã³ãã§ãã¼ããããã¤ãå«ã ã£ãã®ã§æ¡ç¨ããªãã£ãã (Capsã¨Ctrlã®å ¥ãããã§ãçµå±ã¬ã¸ã¹ããªããããªãã¨ãã¾ããããªãã£ããã¨ããã®ã«ä»¥åã¶ã¤ãã£ããããã®ã§)
æ段ãã®2 xmodmapã使ã
xmodmapã¯linuxã¨ããããXã®ä¸çã§ãã¼ãããå¤æ´ããããã®ãã®ã調ã¹ã¦ã¿ãã¨æè¿ã¯å¥ã®ãããã£ã½ããã©ãxmodmapã§ãã¾ãåããã®ã§æ°ã«ããªãã
ãããããã¼ã³ã¼ããªãã¦å¤ãããªãã¨æãã®ã§ãåãè¨å®ã§åãããã«åãã¯ãã
æé 1. ãã¼ã³ã¼ããç¹å®ãã
xev
ã¨ããã³ãã³ãã使ãã¨ãXã®ã¢ããªãèµ·åãã¦ãããã§ããããã®ã¤ãã³ããæ¨æºåºåã«åºãã¦ç¢ºèªãããã¨ãã§ããã
ããã使ãã¨ãå¤æã¨ç¡å¤æã®ãã¼ã³ã¼ãã¯ä»¥ä¸ã®ã¨ãããå¤æã129ãç¡å¤æã131ã§ãããã¨ããããã
KeyRelease event, serial 33, synthetic NO, window 0x800001, root 0xf4, subw 0x0, time 426541921, (67,97), root:(179,232), state 0x0, keycode 131 (keysym 0xff22, Muhenkan), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 33, synthetic NO, window 0x800001, root 0xf4, subw 0x0, time 426596187, (843,330), root:(955,465), state 0x0, keycode 129 (keysym 0xff23, Henkan_Mode), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
æé 2. xmodmapã®åä½ç¢ºèªãã
ãã¼ã³ã¼ããããã£ãããxmodmap
ã³ãã³ãã§ä¸æçã«ãã¼ã·ã ãæ¸ãããã¦åä½ç¢ºèªãã¦ã¿ãã
# xmodmap -e "keycode 131 = Super_L Super_L" # xmodmap -e "keycode 129 = Hyper_L Hyper_L"
å®è¡å¾ãå度xevã使ã£ã¦æå¾ éãå¤ãã£ã¦ãããã¨ã確èªããã
KeyPress event, serial 33, synthetic NO, window 0x800001, root 0xf4, subw 0x0, time 426819890, (125,123), root:(263,284), state 0x0, keycode 131 (keysym 0xffeb, Super_L), same_screen YES, XKeysymToKeycode returns keycode: 115 XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
å ç¨ã¯ãã¼ã³ã¼ã131ãç¡å¤æã ã£ãã®ããSuperã«å¤ãã£ã¦ãããã¨ããããã
æé 3. xmodmapã®è¨å®ãä½æãã
調ã¹ãã¨ãxmodmap -pke
ãå®è¡ãã¦ãå¿
è¦ãªã¨ããã ãæ¸ãããã¾ããããã¨ããã®ãåºã¦ããã®ã ããå®éã®ã¨ããå¿
è¦ãªè¨å®ã ãæ¸ãã°ããã£ãã®ã§ããããªã .Xmodmap
ãã¡ã¤ã«ãä½æããã
WSLã§ææã¡ã®Xãµã¼ã使ãåã«ã¯å¥ã«ãã¡ã¤ã«åã¯ä½ã§ãããã¨æãã®ã ããããã¯æ
£ä¾ã«å¾ã£ã¦ããã(startxã³ãã³ãã§xèµ·åããã¨ãã¯ãéå½¢ã§.Xmodmapãè© ã¿è¾¼ãã®ã§ãã¡ã¤ã«åéè¦)
èªåã®è¨å®ã¯ããããªãããã
https://github.com/grugrut/dotfiles/blob/master/.Xmodmap
clear mod3 clear mod4 !<muhenkan> keycode 129 = Hyper_L Hyper_L Hyper_L Hyper_L !<henkan> keycode 131 = Super_L Super_L Super_L Super_L add mod3 = Hyper_L add mod4 = Super_L Super_R
ããã©ã«ãã®ç¶æ ã ã¨ãSuperãã¼ã¨Hyperãã¼ãåã修飾ãã¼ã¨ãã¦ãã¤ãããã¦ãã¦ãHyperãã¼åä½ã§ãã¾ãããã¨ããªãã®ã§ä½¿ããã¦ããªãmod3ã«Hyperãã¼ãå²å½ã¦ãããã
æé 4. èªåã§é©ç¨ãããããã«ãã
xmodmap ~/.Xmodmap
ã¨ã³ãã³ãå®è¡ããã°ããã®ã ãã©ã注æç¹ãä¸ã¤ã
xmodmapã¯Xãµã¼ãã«å¯¾ãã¦è¨å®ããããªãã³ãã³ããªã®ã§ãXãµã¼ããèµ·åãã¦ããªãç¶æ
ã§ã¯ãã¾ãåããªãã
LinuxãBSD使ã£ã¦ãã¨ãã«ãxmodmap使ã£ã¦ããã©ãå½æã¯å¸¸ã«xorg-serverãèµ·åãã¦ãã®ã§ä»åã¯ããã¦ãã®ãã¨ç¥ã£ãã
ã¤ãã§ãªã®ã§ãOSãã°ã¤ã³æã«Xãµã¼ããèµ·åãã¹ãé©å½ãªbatãä½æããã https://github.com/grugrut/dotfiles/blob/master/_windows/startx.bat
start /b x410.exe ubuntu.exe run "DISPLAY=127.0.0.1:0.0 xmodmap ~/.Xmodmap"
x410.exeã使ã£ã¦ããXãµã¼ããããã¯ã°ã©ã¦ã³ãå®è¡ããããã®ã§ã/b
ãªãã·ã§ã³ãã¤ãã¦ãã
ããã¦ãubuntu.exe run
ããããã¨ã§wslã§ã³ãã³ãå®è¡ã§ããã
ããã Windowsã® shell:startup
ã«é
ç½®ãããã¨ã§ã¹ã¿ã¼ãã¢ããæã«èªåå®è¡ãããã¨ãã§ããã
ãã ããç´æ¥ãããããã·ã§ã¼ãã«ãããé
ç½®ãããã¨ããããããããç´æ¥é
ç½®ããã¨ãå®è¡æã«ã³ãã³ãããã³ãããä¸ç¬è¡¨ç¤ºããã¦ãã£ã¨ãããããã·ã§ã¼ãã«ããã§ããã°æå°åãã¦å®è¡ãããã¨ãã§ããã®ã§æ°ã«ãªããªãããã ã
ã¾ã¨ã
xmodmapã使ããã¨ã§ãä»ã®ã¢ããªã«ã¯å½±é¿ãªãwslã®X使ãã¢ããªã ãã«ããããæãããããããã¨ã確èªã§ãããä»ã«ããã®æã®æ©è½ã§ä¾¿å©ãªã®ããããã
-
ãã¶ã
w32-lwindow-modifier
ã¨ãã使ããã¯ã↩
cephã1ãã¼ãã§æ§ç¯ãã
æè¿ä½ã£ãkubernetesã®ã¯ã©ã¹ã¿ã®Persistent Volumeãä½ã«ãããèãã¦ãã¦ãNFSã§ãããã®ã ãã©ããã£ããã ããdynamic provisioningãä½é¨ããã¹ããcephãå°å ¥ãã¦ã¿ããã¨ã«ããã
ã¨ã¯ãããåé·æ§æã«ããã¨ãVMã ããã«ãªã£ã¦ãã£ã¨ãããã®ã§ã1ãã¼ã(All-in-one)ã§ä½ã£ã¦ã¿ãã
åèã«ãããã¼ã¸
- å ¬å¼ããã¥ã¡ã³ã (å½ç¶ãã
- ceph-ansibleã§all-in-oneã§å°å ¥ããè¨äº
- debianã§ceph-deployã§å°å ¥ããè¨äº
ç°å¢
ãã¤ãã®Hyper-Vä¸ã®fedora30ã®VMã ãªãã1ãã¼ãæ§æã§ããã£ã¹ã¯è¤æ°ç¨æããã£ã½ãã®ã§ãã®ããã«ãããããã¥ã¡ã³ãã¿ã¦ãè¤æ°ãã¼ãåæã§æ¸ããã¦ã¦ã1ãã¼ãã®å ´åã«ãã£ã¹ã¯ãæ¬å½ã«è¤æ°å¿ è¦ãªã®ãã¯èª¿ã¹ã¦ãªãã
å°å ¥æé
ã¯ãããqiitaã§Red Hatã®ä¸ã®äººã®æé ã§ãã®ã¾ã¾ãããã¨ããã®ã ãã©ã ansible-playbook
ã³ãã³ãããã¾ãåããªãã£ãã®ã§ãããããã«ããããããã¶ãè¨å®ãããªã®ã ãããã©ã
ã§ãceph-deployã使ããã¨ã«ããã
dnfã§å ¥ããªãã£ã(pythonã¾ããã®ä¾åé¢ä¿ãããããã£ã)ã®ã§ãpipã§ã¤ã³ã¹ãã¼ã«
# pip install ceph-deploy
ãã¨ã¯ããã¥ã¡ã³ãã©ãããªã®ã ãã©
# mkdir my-cluster # cd my-cluseter # ceph-deploy new storage01.mshome.net
ããã§ã ceph.confãä½æãããã®ã§ãã¡ãã£ã¨ç·¨éã以ä¸ã®è¡ã追å ããã
[osd] osd_pool_default_size = 1 osd_crush_chooseleaf_type = 0
ãã¨ã¯ãceph-deploy installã®ã¨ãã«ãfedoraã®å ´åããã¾ãåå¨ããrepositoryãã¿ã«ãã£ã¦ãããªãã£ãã®ã§ãç´æ¥æå®
# ceph-deploy install --repo-url https://download.ceph.com/rpm-nautilus/el7/noarch/ceph-release-1-1.el7.noarch.rpm storage01 # ceph-deploy mon create-initial # ceph-deploy admin storage01 # ceph-deploy mgr create storage01 # ceph-deploy osd create --data /dev/sdb storage01 # ceph-deploy osd create --data /dev/sdc storage01 # ceph-deploy osd create --data /dev/sdd storage01
確èªã³ãã³ãå®è¡ãã¦ã¿ãã¨ãã¡ããã¨ã§ããã£ã½ãã
# ceph health HEALTH_OK # ceph -s cluster: id: c067a00a-46f7-474f-90f3-5f244b5d695f health: HEALTH_OK services: mon: 1 daemons, quorum storage01 (age 7m) mgr: storage01(active, since 3m) osd: 3 osds: 3 up (since 11s), 3 in (since 11s) data: pools: 0 pools, 0 pgs objects: 0 objects, 0 B usage: 3.0 GiB used, 375 GiB / 378 GiB avail pgs:
以ä¸
kubernetesã¯ã©ã¹ã¿ã¯DHCPã¯å©ç¨ããstatic ipã§ä½æãã¹ã
件å以ä¸ã®ãã¨ã¯ãªããã¾ãæ®éã®ææ§ãªããããããããã¨ãããã¨ãããªã
ã§ä½ã£ãã¯ã©ã¹ã¿ã ããæ®å¿µãªããOSåèµ·åæã«ã¶ã£ãããã¦ãã¾ã£ãã
ææããã¦DHCPã§ãã£ã¦ããããetcdããapiserverããããå
ã®IPã¢ãã¬ã¹ã«æ¢ãã«ãã£ã¦ãã¾ããå¿
è¦ã³ã³ãã¼ãã³ããã¾ãã§èµ·åããªãã
ãã°ãã¿ã¦ã¿ãã¨ã
```
Jul 3 18:30:56 master01 kubelet[1437]: E0703 18:30:56.729641 1437 controller.go:115] failed to ensure node lease exists, will retry in 7s, error: Get https://lb01.mshome.net:6443/apis/coordination.k8s.io/v1beta1/namespaces/kube-node-lease/leases/master01.mshome.net?timeout=10s: dial tcp: lookup lb01.mshome.net on 192.168.217.225:53: read udp 192.168.217.233:46188->192.168.217.225:53: i/o timeout
```
ã¿ãããªæãã§å¤ãIPã¢ãã¬ã¹(192.168.217.233)ã使ããã¨ãã¦ããã®ããããã
/etc/kubernetes/manifests/etcd.yaml ã¨ããè¦ãã¨ç¢ºãã«IPã¢ãã¬ã¹ããã¿æ¸ãããã¦ãã®ã§ãä¿®æ£ãã¦ã¿ããã©ãç¶æ³ãã¾ãããããã
ãã¹ãå解決ã§å¤±æãã¦ããã®ã§ãcoreDNSãããããã®ã ãã©ã
ãããã«ãã¦ããipããããã³ã«ããããä¿®æ£ããã®æéã§ãããªãã®ã§ãstatic ipã§ä½ãç´ããã¨ã«ããã
ã¯ã©ã¹ã¿ãæ§æãããã¼ãã®æ
å ±ãã©ãã«ãã©ã®ããã«æ ¼ç´ããã¦ãããã¯æ°ã«ãªãã®ã§ãæ£ããåããããããã¦ãããããã
ããããDHCPã§ããã£ããã¦å¤æããã®ããããã¥ã¡ã³ãã«
```
It is not recommended to use an IP address directly in a cloud environment.
```
ã¨ãã£ãã®ã§ãã¯ã©ã¦ãã ã¨ãããã«IPå¶å¾¡ã§ããªããããã¹ãåã§è§£æ±ºã§ããç°å¢ãªããããã ãªã£ã¦å¤æãã¦ãã¾ã£ãã®ã ãã©ãããLoadBalancerã®æ¡ä»¶ã ã£ãã®ã§ã誤èªã§ããã
ãã£ã±minikubeã¨ãããã¼ã¸ãã«é ¼ããªãèªåã¯ã©ã¹ã¿çµãã§ã¿ãã¨ãããããäºæãã¬ã¨ããã§ã¯ã¾ã£ã¦èå³æ·±ãã§ã
é«å¯ç¨æ§k8sã¯ã©ã¹ã¿ãkubeadmã§æ§ç¯ãã¦ã¿ã
ã¯ããã«
æè¿ã³ã³ããã«å ¥å¦ããã®ã§ãããã¡ã¯ã©ã¹ã¿ãä½ã£ã¦ã¿ããã¨ã«ãããPCã®ã¡ã¢ãª64Gã¾ã§å¢å¼·ããã®ã§ä»®æ³ãã·ã³ã°ãã°ã建ã¦ãä½åããããã
ã¨ããã¤ã¤ãã·ã³ã°ã«ãã¹ã¿ã®ã¯ã©ã¹ã¿ã¯ãæã¯ãã£ãã©ãºãã¤ã¯ã©ã¹ã¿ä½ãã¨ãã«ä½é¨æ¸ã§ããã£ãããªã®ã§ãã«ããã¹ã¿ã¯ã©ã¹ã¿ãçµãã§ã¿ããã¨ã«ããã è¦å´ã¯ãããã©ãè¦å´ãããã¤ã³ãã
- ããã¥ã¡ã³ããå³å¾å·¦å¾ããããã
- ã¿ã¤ããã¦ã
ã大åãªã®ã§ãã»ã¼ããã¥ã¡ã³ãã¸ã®ãªã³ã¯éã
æ§æ
åä¸Windowsãã·ã³ã®Hyper-Vä¸ã®ä»®æ³ãã·ã³ã¨ãã¦æ§ç¯ãã
ç¨é | ãã¹ãå | OS | CPU | ã¡ã¢ãª *1 |
---|---|---|---|---|
ãã¹ã¿ã¼ãã¼ã | master01.mshome.net | Fedora 30 | 2ã³ã¢ | 2GiB |
master02.mshome.net | Fedora 30 | 2ã³ã¢ | 2GiB | |
master03.mshome.net | Fedora 30 | 2ã³ã¢ | 2GiB | |
ã³ã³ãã¥ã¼ããã¼ã | node01.mshome.net | Fedora 30 | 4ã³ã¢ | 4GiB |
node02.mshome.net | Fedora 30 | 4ã³ã¢ | 4GiB | |
node03.mshome.net | Fedora 30 | 4ã³ã¢ | 4GiB | |
ãã¼ããã©ã³ãµ | lb01.mshome.net | Fedora 30 | 2ã³ã¢ | 2GiB |
ã©ãã®è¨å®ã調ã¹ã¦ãªããã©ãmshome.netã«ããã¨ãã¹ãã®Windowsæ©ãããã追å è¨å®ãªãã«åå解決ã§ãã¦ä¾¿å©ã ã£ãã®ã§ãFQDNã¯ãã®ããã«è¨å®ããã
ã¤ã³ã¹ãã¼ã«
ä»®æ³ãã·ã³ã®ä½æ
Hyper-Vã¯ä»®æ³ãã·ã³ã®è¤è£½ãã(ç°¡åã«ã¯)ã§ããªãã®ã§ãããã©ãããã
docker-ceã®ã¤ã³ã¹ãã¼ã«
åºæ¬çã«ã¯ããã¥ã¡ã³ãã®éããfedoraã§ã¯yumã®ãããã«dnfãæ¡ç¨ããã¦ãåºæ¬çã«yumã³ãã³ãã使ããã®ã ãã©ãyum-utils
ã¯ä½¿ããªãã®ã§ã¬ãã¸ããªè¿½å ã¯ã yum-config-manager
ã®ãããã«ã
$ sudo dnf config-manager --add-repo url
ã¨ããå¿ è¦ãããã
Yum-utils package has been deprecated, use dnf instead. See 'man yum2dnf' for more information.
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. http://dummy
ã¿ãããªåºåãªã®ã§ãdocker-ceã®repoãã¡ã¤ã«ãããããã®ãã¨æã£ã¦ãããããã§ã¯ãªãã£ãã
master/computeã®æ§ç¯
ããã¥ã¡ã³ãã®ã¨ãããå¾è¿°ã®åé¡ã®ã¨ãããweaveã使ãå ´åã¯ãæ§ç¯èªä½ã¯å®äºãããããã®å¾åé¡ããããã®ã§è¦æ³¨æã
Creating Highly Available clusters with kubeadm - Kubernetes
ãã¼ããã©ã³ãµã®è¨å®
apiãmasterã«åæ£ããããã«ããã¼ããã©ã³ãµãå¿ è¦ã«ãªããä»åã¯haproxyã使ã£ãã /etc/haproxy/haproxy.cfgã«é©å½ã«è¨å®æ¸ããã
frontend k8s bind *:6443 mode tcp default_backend k8s backend k8s balance roundrobin mode tcp option tcp-check server master01 master01.mshome.net:6443 check server master02 master02.mshome.net:6443 check server master03 master03.mshome.net:6443 check
åé¡ç¹
corednsãåããªã
kubectl get podã§è¦ã¦ã¿ããcorednsã ããåãã¦ãªã(ãã¥ããkubernetes-dashboardãdeployãã¦ããæ°ä»ãã)
$ kubectl get all -n kube-system NAME READY STATUS RESTARTS AGE pod/coredns-5c98db65d4-phqkw 0/1 ContainerCreating 0 71m pod/coredns-5c98db65d4-tznld 0/1 ContainerCreating 0 71m pod/etcd-master01.mshome.net 1/1 Running 0 70m pod/etcd-master02.mshome.net 1/1 Running 0 32m pod/etcd-master03.mshome.net 1/1 Running 0 33m pod/kube-apiserver-master01.mshome.net 1/1 Running 0 70m pod/kube-apiserver-master02.mshome.net 1/1 Running 0 32m pod/kube-apiserver-master03.mshome.net 1/1 Running 0 33m pod/kube-controller-manager-master01.mshome.net 1/1 Running 1 70m pod/kube-controller-manager-master02.mshome.net 1/1 Running 0 32m pod/kube-controller-manager-master03.mshome.net 1/1 Running 0 33m pod/kube-proxy-kdfbj 1/1 Running 1 54m pod/kube-proxy-ndcdt 1/1 Running 1 55m pod/kube-proxy-qvpkr 1/1 Running 1 54m pod/kube-proxy-spwnw 1/1 Running 0 33m pod/kube-proxy-vhjtg 1/1 Running 0 32m pod/kube-proxy-vw4w5 1/1 Running 0 71m pod/kube-scheduler-master01.mshome.net 1/1 Running 1 70m pod/kube-scheduler-master02.mshome.net 1/1 Running 0 32m pod/kube-scheduler-master03.mshome.net 1/1 Running 0 33m pod/kubernetes-dashboard-7d75c474bb-9rp8z 0/1 ContainerCreating 0 28m pod/weave-net-5kf5b 2/2 Running 2 54m pod/weave-net-5rbgf 2/2 Running 2 55m pod/weave-net-69v4x 2/2 Running 2 54m pod/weave-net-bc4sb 2/2 Running 0 32m pod/weave-net-jql64 2/2 Running 0 59m pod/weave-net-k6d2h 2/2 Running 0 33m
ãã詳ããè¦ã¦ã¿ãã¨ãããªæã
$ kubectl describe po coredns-5c98db65d4-phqkw -n kube-system Name: coredns-5c98db65d4-phqkw Namespace: kube-system Priority: 2000000000 Priority Class Name: system-cluster-critical Node: master01.mshome.net/192.168.112.71 Start Time: Sun, 23 Jun 2019 09:07:10 +0900 Labels: k8s-app=kube-dns pod-template-hash=5c98db65d4 Annotations: <none> Status: Pending IP: Controlled By: ReplicaSet/coredns-5c98db65d4 Containers: coredns: Container ID: Image: k8s.gcr.io/coredns:1.3.1 Image ID: Ports: 53/UDP, 53/TCP, 9153/TCP Host Ports: 0/UDP, 0/TCP, 0/TCP Args: -conf /etc/coredns/Corefile State: Waiting Reason: ContainerCreating Ready: False Restart Count: 0 Limits: memory: 170Mi Requests: cpu: 100m memory: 70Mi Liveness: http-get http://:8080/health delay=60s timeout=5s period=10s #success=1 #failure=5 Readiness: http-get http://:8080/health delay=0s timeout=1s period=10s #success=1 #failure=3 Environment: <none> Mounts: /etc/coredns from config-volume (ro) /var/run/secrets/kubernetes.io/serviceaccount from coredns-token-kwrq4 (ro) Conditions: Type Status Initialized True Ready False ContainersReady False PodScheduled True Volumes: config-volume: Type: ConfigMap (a volume populated by a ConfigMap) Name: coredns Optional: false coredns-token-kwrq4: Type: Secret (a volume populated by a Secret) SecretName: coredns-token-kwrq4 Optional: false QoS Class: Burstable Node-Selectors: beta.kubernetes.io/os=linux Tolerations: CriticalAddonsOnly node-role.kubernetes.io/master:NoSchedule node.kubernetes.io/not-ready:NoExecute for 300s node.kubernetes.io/unreachable:NoExecute for 300s Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedScheduling 60m (x11 over 74m) default-scheduler 0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate. Normal Scheduled 60m default-scheduler Successfully assigned kube-system/coredns-5c98db65d4-phqkw to master01.mshome.net Warning FailedCreatePodSandBox 60m kubelet, master01.mshome.net Failed create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "cfeba2e58c4cbca0af13ce92e804804077f336ca4f5f11bfb8aca05f1822164a" network for pod "coredns-5c98db65d4-phqkw": NetworkPlugin cni failed to set up pod "coredns-5c98db65d4-phqkw_kube-system" network: failed to find plugin "loopback" in path [/opt/cni/bin], failed to clean up sandbox container "cfeba2e58c4cbca0af13ce92e804804077f336ca4f5f11bfb8aca05f1822164a" network for pod "coredns-5c98db65d4-phqkw": NetworkPlugin cni failed to teardown pod "coredns-5c98db65d4-phqkw_kube-system" network: failed to find plugin "portmap" in path [/opt/cni/bin]] Normal SandboxChanged 5m29s (x257 over 60m) kubelet, master01.mshome.net Pod sandbox changed, it will be killed and re-created. Normal SandboxChanged 15s (x12 over 2m20s) kubelet, master01.mshome.net Pod sandbox changed, it will be killed and re-created.
failed to find plugin "portmap" in path [/opt/cni/bin]
ã¨ããã®ã§ããããªãã§ããããã¨èª¿ã¹ã¦ã¿ãã¨ãä»å使ã£ã(ããã¥ã¡ã³ãã©ããã«ãã£ã¦ãã¨å°å
¥ããã)CNIã¯ãweave netãªãã ãã©ãããã¯portmapãä¸è¦ãªã®ã§å°å
¥ãã¦ãä¸ç·ã«ã¯å
¥ããªãã®ã§ãå¿
è¦ãªãèªåã§å
¥ãããã¨ãããã¨ã®ããã ã
https://www.weave.works/docs/net/latest/kubernetes/kube-addon/
ãã¤ããªãã¦ã³ãã¼ããã¦ãã¦é ç½®ãã¦ç¡äºèµ·åãã(æ£ç¢ºã«ã¯ãloopbackãå¿ è¦ã ã£ã)
ããã·ã¥ãã¼ã
ããã©ã«ãã§ã¯WebUIã¯åå¨ãããcliã ããªã®ã§ãããã·ã¥ãã¼ããå ¥ãã
https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/
NodePortããªãã使ãã°å¤ããè¦ããã¨æããã©ãä¸æ¦,kubectl proxyãã¦ãsshãã¼ããã©ã¯ã¼ãã£ã³ã°ã§ç¢ºèªã
ã¨ããããä»æ¥ã®ã¨ããã¯ããã¾ã§
*1:åçã¡ã¢ãªã®è¨å®ãã¦ãã®ã§åèç¨åº¦ãããæ¸ããªãã確èªããããã¹ã¿ã«3GiBå²ãå½ã¦ããã¦ãã
:ensure tã:straight tã«ãããããã¨ãããããstraight.elã使ã£ã¦ã¿ãããMELPAã§ãgithubã§ãã©ãã®ããã±ã¼ã¸ãåå¾ã§ããã
èªå㯠use-package
ã§ãemacsã®ããã±ã¼ã¸ç®¡çããã³è¨å®ç®¡çããã¦ããã
use-packageã¯ãé
延ãã¼ãã¨ããæèããªãã¦ããããªã«ãã£ã¦ããããããªã«ãã :ensure
ãã¼ã¯ã¼ãã使ããã¨ã§ãMELPAãããã¦ã³ãã¼ããèªåã§ãã£ã¦ãããã®ã§ãããã±ã¼ã¸ã®åå¾ã¨è¨å®ãä¸å
管çãããã¨ãã§ããã®ãããã
ãã ããããªuse-packageã ãã©ãä¸æºç¹ãã²ã¨ã¤ããã package.el
ãã©ããã³ã°ãã¦ãã ããªã®ã§ãå½ç¶ã®ãã¨ãªãã package.el ã®å¯¾è±¡ã®ãµã¤ãã§ãããelpa, melpaãªã©ããããããã±ã¼ã¸ãåå¾ãããã¨ãã§ããªãã
ãªã®ã§ãgithubã§ç®¡çããã¦ãã¦ãmelpaã®ã¬ã·ããä½æããã¦ããªããã®ã¨ããmelpaã«ãããã ãã©ãã°ããã£ã¦ãã©ã¼ã¯çãgithubã«ããã¨ãããããã£ããã®ã管çããã®ãããã©ãããã èªåã§ãã¦ã³ãã¼ããã¦ãload-pathã«é ç½®ãã¦ãã¨ããä½æ¥ãå¿ è¦ã«ãªã£ã¦ãã¾ãã®ã ã
ãã¨ãã£ã¦ããã®ããã«cask使ã£ã¦ã¿ãã®ããªããããã¨æã£ã¦ãããquelpaã¨ãã使ã£ã¦ã¿ãã®ã ãã©ã¤ãã¤ãã±ã£ã¨ããªãã£ããã
ãããªãªããstraight.elã®åå¨ãç¥ã£ã¦ä½¿ã£ã¦ã¿ãã®ã§ãããããããã£ããããããã
ä½ãããã£ã¦ãuse-packageã®ãã¼ã¯ã¼ãã«è¿½å ãã¦ãããã®ã§ãä½ãèããªããã°ãããã¾ã§ :ensure t
ã¨æ¸ãã¦ãã¨ããã :straight t
ã¨ä¸æ¬ç½®æããã ãã§ãã¨ããããä¹ãæããå®äºããã®ã§ãã
(use-package dash :straight t)
ãããªæãã§ããã¾ã移è¡ãæèããªãã¦ããã®ãããã
melpaã§ç®¡çããã¦ãããã®ã®ãã©ã¼ã¯çã使ããããã®ã®ä¾ã¨ãã¦ã¯ãkey-chordãããã¾ãã
ãããã :straight
ãã¼ã¯ã¼ããã¡ãã£ã¨å¤ãã¦åå¾å
ãæå®ããã ããªã®ã§ãé常ã«ç°¡åã«æ¸ãã¾ãã
(use-package key-chord :straight (:host github :repo "zk-phi/key-chord" :branch "master"))
æ£ç´ãããã¾ã§æèããã«ç§»è¡ã§ããã¨æããªãã£ãã®ã§ããªãæ©ãä¹ãæããªãã£ãã®ãæãã°ããã以åããstraightèãã¦ããã©ãreadme.mdãã¡ãã£ã¨èªã¿ã«ããã¦ãã©ãããã¢ãããããããªãã£ãã®ãããããã¾ããã ãããããã®ã¨ã³ããªãæ¸ãã«ããã£ãã®ã§ããã
use-packageã§æè¿ç¥ã£ãæ©è½3é¸
æè¿ã.emacsã®æ´çããã¦ãã¦ãuse-packageãããã©ã«ãã§diminishãä»å±ãããªããã¨ãç¥ãã¾ããã
ã§ãã¤ãã§ã«README.orgãããããã¦èªã¿ãããã¦ãããããã¾ã§ç¥ããªãã£ãé¢ç½ãæ©è½ãããã¤ããããã¨ãç¥ã£ãã®ã§ç´¹ä»ã
(package.elã使ãã¨ãemacsä¸ã§ã¢ãããã¼ããã§ãã¦ãã¾ãã®ã§ãç ´å£çãªå¤æ´ã«æ°ä»ããã«ããã¤ã®ã¾ã«ãæåå¤ãã£ã¦ã...ã£ã¦ãã¨ããã°ãã°ããã®ãåä»ã§ãã)
ã¡ãªã¿ã«ãuse-packageã®åºæ¬çãªä½¿ãããã¯ãkai2nenobuããã®ããã®è¨äºããå§ãã
imenuã«å¯¾å¿ããã
å人çã«ä»åããªãã®ãããã ã£ãã®ãããã
(setq use-package-enable-imenu-support t) (require 'use-package)
ã¨ããã¨ãemacslisp-modeã®å ´åã«ãuse-packageã®åããã±ã¼ã¸è¨å®ãimenuã«è¼ã£ã¦ãã¦ãããã
ãã¤ã³ãã¯ãrequireã®åã«æ¸ããã¨ã
ããã¾ã§ãinit.elããç®çã®è¨å®ãæ¢ãã®ã«ãisearchãã¦ã¿ãããhelm-swoopãã¦ã¿ããã¨è¦æ¦ãã¦ããã®ã ãã©ãä¸çºã§ã¸ã£ã³ãã§ããããã«ãªã£ãã
use-packageã®ç¶æ³ã確èªãã
(use-package-compute-statistics t)
ãã¦ããã¨ãM-x use-package-reportã§ãåããã±ã¼ã¸ã®èªã¿è¾¼ã¿ç¶æ³(:configã¾ã§é²ãã ã¨ãã:initã¾ã§ã¨ã)ããããã
ç¶æ³ãå¤åããæ¥æã¨æéããããã®ã ãã©ãå¤åç´¯è¨ãããªãã¨æããorg-modeã®loadããããªçãããããªãã®ã§ã
key-chordãè¨å®ãã
key-chordã¯ãemacsã«åææ¼ããå®ç¾ããããã±ã¼ã¸ã§ãã
use-packageã®ãã¯ãã«ãã®è¨å®ãçµã¿è¾¼ããã¨ãã§ãããããã
(use-package use-package-chords :ensure :config (key-chord-mode 1)) (use-package view :ensure :defer t :chords (("jk" . view-mode)))
ãããªæãã§ã:chordsãã¼ã¯ã¼ãã使ããããã«ãªãã
ãã æ®å¿µãªã®ãã使ããã®ããªãªã¸ãã«ã®key-chordãªã®ã§ãæ´çºåé¡ãæ®ã£ã¦ããã
ãã¡ãã®æ¹è¯çã®æ¹ã便å©ã ã¨æãã®ã§ä½¿ãã©ãããã(ãã¾ãä¸æ¸ãã§ããã°ãããã ãã©)
ã¡ãªã¿ã«ããã®ãã¯ãæ¡å¼µã®ããã®æ©è½ãæä¾ããã¦ããããã§ãç´æ£ã®ãã®ä»¥å¤ã«ããhydraã使ããããã«ããuse-package-hydraãªãã¦ã®ãããã¿ããã
ãããã«
README.orgãèªãã¨ãä»ã«ãããããæ¸ãã¦ãã(:afterãã¼ã¯ã¼ãã§andã¨ãorã¨ã使ããã£ã¦ãã¨ãç¥ããªãã£ãã使ãã©ããã¯ï¼ã ãã©ã)ã®ã§ãå½ç¶ã®ãã¨ãªãããåå ¸ãã¾ãã¯èªãã¹ãã
Emacsã§ç°¡åã«ã²ã¼ã ãä½ããgamegrid.el
ãã®è¨äºã¯ãEmacsアドベントカレンダー 18æ¥ç®ã®è¨äºã§ãã
ã¡ãã£ã¨Emacsã§ããããã£ã¦ *1 ãããçµµçãªãã®ãæ¸ãããããããã調ã¹ã¦ããã¡ã«gamegrid.elã«åºä¼ãã¾ããã
gamegrid.elã¯ãEmacsæ¬ä½ã«å梱ããã¦ãããã¾ãã«gridãªgameãä½ãããã®ããã±ã¼ã¸ã§ãã
gamegrid.elã§èª¿ã¹ãã¨ãããããåºã¦ãã¾ãããemacsã«å
èµããã¦ããpongã¨ãsnakeãtetrisãªããã«ä½¿ããã¦ãã¾ãã
ããã¦ã使ãããããããããããããã£ã¦ã使ã£ã¦ã¿ãçè¨äºããã£ã¦ã使ãæ¹ãããããããªãã£ã(ã¿ã¤ãããªãã£ããã©ãinfoã«è©²å½ã»ã¯ã·ã§ã³ãã£ããããã®ããªï¼)ã®ã§ãå®é使ããã¦ãããã®ãã½ã¼ã¹ã³ã¼ããªã¼ãã£ã³ã°ããªãã使ã£ã¦ã¿ã¾ããã
ã½ã¼ã¹ã³ã¼ããªã¼ãã£ã³ã°ããä¸ã§ã¯ãsnakeã²ã¼ã ã®ã½ã¼ã¹ã³ã¼ããããããããã£ããtetrisã¯ã¡ãã£ã¨è¤éã
github.com
ä½ã£ããã®
ããããä¸ããéã£ã¦ãããã£ã©ãé¿ããã²ã¼ã ããã¼å ¥åå¨ãã®ã¨ãããè¥å¹²ããããã
å 容ã¨è§£èª¬
ç解ãããã¦ãªãã¨ãããããã®ã§ãééãããã°ããµã«ãªãã ããã
ã©ããã£ã¦æç»ããã
(defconst sample1-player 0) (defconst sample1-block 1) (defconst sample1-blank 7) (defconst sample1-border 8) (defconst sample1-space 9)
gamegridã®åã®ã¨ãããgridãã¼ã¹ãªã®ã§ãx, y座æ¨ã«å¯¾ãã¦ããã®ã»ã«ãä½ã§ããããæå®ãããã¨ã«ãªãããã®æå®ã®ããã®å®æ°å®ç¾©ã
(defvar sample1-player-options '(((glyph colorize) (t ?\040)) ((color-x color-x) (mono-x grid-x) (color-tty color-tty)) (((glyph color-x) [1 0 0]) (color-tty "red"))))
(defun sample1-display-options () "." (let ((options (make-vector 256 nil))) (dotimes (c 256) (aset options c (cond ((= c sample1-blank) sample1-blank-options) ((= c sample1-player) sample1-player-options) ((= c sample1-block) sample1-block-options) ((= c sample1-border) sample1-border-options) ((= c sample1-space) sample1-space-options) (t '(nil nil nil))))) options))
å
ã®å®æ°ãããã使ã£ã¦ãã©ã®ã»ã«ãã©ãæç»ãããã決ããã¨ãããXã®å ´åã¯ã [1 0 0]ã®ããã«vectorã§ãr g bã0ãã1ã®ç¯å²ã§è¨å®ããã
ã¿ã¼ããã«ã®å ´åã¯ã"red"ã®ããã«ãæå®ã§ãããã¿ã¼ããã«ã®å ´åã«ãªã«ã使ããã®ãã¯èª¿ã¹ã¦ãªãã
ã¾ããXã使ãå ´åã¯ãç»åãxpmå½¢å¼ã§æå®ã§ããã¯ããæªæå®ã®å ´åã¯ãããã©ã«ãã®ãããã¯ç»åã使ãããã
ãã®è¾ºãé§ä½¿ããããã以ä¸ã®åæåå¦çã§ããããè¨å®ããã
åæåå¦çã¨æ¯ã¿ã¼ã³ã®æç»
åºæ¬çã«ã¯ã¡ã¸ã£ã¼ã¢ã¼ãæ¸ãã¦ä½ãæãããã以å¤ã®gamegridç¹æã®å 容ã ã¨ä»¥ä¸ãªæã
(defun sample1-start-game () "." (interactive) (sample1-reset-game) ;;(use-local-map sample1-mode-map) (gamegrid-start-timer sample1-tick 'sample1-update-game))
gamegrid-start-timerã§ä½ããªç§ééã§ã©ã®é¢æ°ãã³ã¼ã«ããããè¨å®ã§ããããã®ã¿ã¤ãã¼ééãFPSç¶æãããããªä»çµã«ãªã£ã¦ããã©ããã¯æªèª¿æ»ã
sample1-reset-gameã®ä¸ã§ã¯ã (gamegrid-kill-timer)ã§ã¿ã¤ãã¼ã念ã®çºãªã»ãã + 以ä¸ã®ãããªæãã§ãgamegrid-init-bufferã«ãããgamegridã§æç»ããç¯å²ã¨åæå¤ãæå®ãã¦ããã
(defun sample1-init-buffer () "." (gamegrid-init-buffer sample1-width (+ 2 sample1-height) sample1-space) (let ((buffer-read-only nil)) (dotimes (y sample1-height) (dotimes (x sample1-width) (gamegrid-set-cell x y sample1-space)))))
ã¤ãã§ã«ãgamegrid-set-cellã使ããã¨ã§ãæå®ããã»ã«ãå¥ã®å
容ã«å¡ãæ¿ãããã¨ãã§ããã
ãªã®ã§ãupdateã®å
容ããå¤æ´ç¹ãè¨ç®ãã¦ããã£ã©ã移åããå ´åã¯ãåã®æå»ã®ã»ã«ãæ¶ãã¦ãæ°ãã座æ¨ã®ã»ã«ãæç»ãããã¨ãã®å¦çããããã¨ã«ãªãã
ã²ã¼ã ã®çµäº
(defun sample1-stop-game () "." (interactive) (gamegrid-kill-timer) (gamegrid-add-score "sample1-scores" sample1-total-cell))
gamegrid-add-scoreã使ããã¨ã§ããã¤ã¹ã³ã¢ã©ã³ãã³ã°(ãã ããã¼ã«ã«)ãç°¡åã«ä½ãã¦ä¾¿å©
ãã®ä»
ã°ãªãããããã¯ä»¥å¤ã«èªåãæç»ãããã®ã使ãããããã®ã§ã試ãã¦ã¿ããã
ã¾ã¨ã
ãªããæ¨ã使ããããªãããªã¼ã¨æãã®ã§ãããæ´æ°ãæ¿ãããã®ãä½ãã«ã¯é©ãã¦ãªã(çµæ§ãã¥ã¼ãã³ã°ãå¿ è¦)ãããªã®ã§ããã¯ãã¹çãªã²ã¼ã ã¨ãä½ãã®ã«ã¯åãã¦ããã§ãã
*1:æ«æãããã©éä¸ã¾ã§èªåãç§å£ãããããNESã¨ãã¥ã¬ã¼ã¿ä½ãã¨ãã£ãã¨æ¸ãã¦ãããªã®ã§ãgongoããã®ã¢ããã³ãã«ã¬ã³ãã¼ãã¨ã¦ã楽ãã¿ã§ã