{"id":11689,"date":"2016-03-08T00:04:34","date_gmt":"2016-03-07T15:04:34","guid":{"rendered":"http:\/\/a-tak.com\/blog\/?p=11689"},"modified":"2016-03-16T15:16:25","modified_gmt":"2016-03-16T06:16:25","slug":"google-container-engine-part4","status":"publish","type":"post","link":"https:\/\/a-tak.com\/blog\/2016\/03\/google-container-engine-part4\/","title":{"rendered":"Google Container Engine\u306b\u79fb\u884c\u3057\u305f \u305d\u306e4"},"content":{"rendered":"<div id=\"advads-927344840\" class=\"advads-before-content-placement advads-entity-placement\" style=\"margin-left: auto;margin-right: auto;text-align: center;\"><div class=\"advads-adlabel\">\u5e83\u544a<\/div><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7585646298782746\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:inline-block;width:300px;height:250px;\" \ndata-ad-client=\"ca-pub-7585646298782746\" \ndata-ad-slot=\"6112122906\"><\/ins> \n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div><p><img data-recalc-dims=\"1\" decoding=\"async\" class=\"shadow-img\" src=\"https:\/\/i0.wp.com\/a-tak.com\/blog\/wp-content\/uploads\/2016\/02\/gke.jpg?w=700&#038;ssl=1\" srcset=\"https:\/\/a-tak.com\/blog\/wp-content\/uploads\/2016\/02\/gke.jpg 2x,https:\/\/a-tak.com\/blog\/wp-content\/uploads\/2016\/02\/gke.jpg 3x\" alt=\"Gke\" title=\"gke.jpg\"   scale=\"0\"><\/p>\n<p>\u3000\u524d\u56de\u307e\u3067\u3067Nginx\u3068php-fpm\u3092\u30d3\u30eb\u30c9\u3057\u3066Google\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30a2\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002\u4eca\u56de\u306fGoogle Container Engine(GKE)\u306e\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u524d\u56de\u306e\u8a18\u4e8b<\/h2>\n<p><a class=\"embedly-card\" href=\"https:\/\/a-tak.com\/blog\/?p=11679\">Google Container Engine\u306b\u79fb\u884c\u3057\u305f \u305d\u306e3 | A-tak-dot-com<\/a><script async src=\"\/\/cdn.embedly.com\/widgets\/platform.js\" charset=\"UTF-8\"><\/script><\/p>\n<h2>\u305d\u306e\u524d\u306bDB\u3068NFS\u30b5\u30fc\u30d0\u3092\u4f5c\u308b<\/h2>\n<p>\u3000\u4eca\u56de\u3001DB(MariaDB)\u3068WordPress\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304fNFS\u30b5\u30fc\u30d0\u30fc\u306f\u30b3\u30f3\u30c6\u30ca\u3067\u306f\u306a\u304f\u666e\u901a\u306eVM\u3068\u3057\u3066\u7acb\u3061\u4e0a\u3052\u308b\u60f3\u5b9a\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u4f5c\u6210\u65b9\u6cd5\u306f\u904e\u53bb\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a class=\"embedly-card\" data-card-description=\"0\" href=\"https:\/\/a-tak.com\/blog\/?p=11029\">\u304a\u540d\u524d\uff0e\uff43\uff4f\uff4d VPS\u304b\u3089Google Compute Engine\u306b\u30b5\u30fc\u30d0\u30fc\u79fb\u884c\u3057\u305f \u305d\u306e2 | A-tak-dot-com<\/a><script async src=\"\/\/cdn.embedly.com\/widgets\/platform.js\" charset=\"UTF-8\"><\/script><\/p>\n<p>\u3000\u3053\u308c\u3092\u5148\u306b\u3064\u304f\u3063\u3066\u304a\u304b\u306a\u3044\u3068\u30b3\u30f3\u30c6\u30ca\u304cNFS\u3092\u30de\u30a6\u30f3\u30c8\u3067\u304d\u306a\u304f\u3066\u30b3\u30f3\u30c6\u30ca\u8d77\u52d5\u306b\u5931\u6557\u3059\u308b\u306e\u3067\u5148\u306b\u7528\u610f\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<p>\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\ngcloud container &#8211;project &quot;my-project999&quot; clusters create &quot;cluster-web3&quot; &#8211;zone &quot;asia-east1-a&quot; &#8211;machine-type &quot;g1-small&quot; &#8211;scope &quot;https:\/\/www.googleapis.com\/auth\/compute&quot;,&quot;https:\/\/www.googleapis.com\/auth\/devstorage.read_only&quot;,&quot;https:\/\/www.googleapis.com\/auth\/logging.write&quot;,&quot;https:\/\/www.googleapis.com\/auth\/monitoring&quot; &#8211;num-nodes &quot;1&quot; &#8211;network &quot;default&quot; &#8211;enable-cloud-logging &#8211;enable-cloud-monitoring  &#8211;disk-size 20 &#8211;cluster-ipv4-cidr &quot;10.212.0.0\/14&quot;<br \/>\n[\/bash]<\/p>\n<p>\u3000Nginx\u3068PHP-FPM\u3050\u3089\u3044\u3057\u304b\u8d77\u52d5\u3057\u306a\u3044\u306e\u3067disk-size\u3067\u30c7\u30a3\u30b9\u30af\u306e\u30b5\u30a4\u30ba\u309220GB\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u3082\u3063\u3068\u5c11\u306a\u304f\u3066\u3082\u52d5\u304f\u304b\u3082\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u3068100GB\u3082\u78ba\u4fdd\u3059\u308b\u306e\u3067\u52ff\u4f53\u306a\u3044\u3067\u3059\u3002<\/p>\n<p>\u3000&#8211;project\u306f\u81ea\u5206\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u66f8\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u30af\u30e9\u30b9\u30bf\u306e\u540d\u524d\u306f\u300ccluster-web3\u300d\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u3042\u3068\u30de\u30b7\u30f3\u306f\u300cg1-small\u300d\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u63a8\u5968\u306f\u300cn1-standard-1\u300d\u3089\u3057\u3044\u306e\u3067\u3059\u304c\u3001\u3068\u308a\u3042\u3048\u305a\u52d5\u3044\u3066\u306f\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>\u3000&#8211;cluster-ipv4-cidr\u306f\u30af\u30e9\u30b9\u30bf\u304c\u4f5c\u6210\u3059\u308b\u30ce\u30fc\u30c9\u306eIP\u7bc4\u56f2\u3092\u6307\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002\u3042\u3068\u3067MariaDB\u306e\u63a5\u7d9a\u8a31\u53ef\u3092\u3059\u308bIP\u7bc4\u56f2\u3092\u6307\u5b9a\u3059\u308b\u3068\u304d\u306b\u3053\u3053\u3067\u6307\u5b9a\u3057\u305f\u7bc4\u56f2\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000\u3068\u306f\u3044\u3048\u6700\u521d\u306f\u4f55\u3092\u6307\u5b9a\u3057\u3066\u3044\u3044\u304b\u308f\u304b\u3089\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u5916\u3057\u3066\u30af\u30e9\u30b9\u30bf\u3092\u7acb\u3061\u4e0a\u3052\u3066\u3001GCP\u306eWeb\u30b3\u30f3\u30bd\u30fc\u30eb\u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30eb\u30fc\u30eb\u3067\u300cgke-cluster-web3-xxxxxx-all\u300d(cluster-web3\u306f\u30af\u30e9\u30b9\u30bf\u306e\u540d\u524d)\u3092\u63a2\u3057\u3066IP\u306e\u7bc4\u56f2\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3000\u30af\u30e9\u30b9\u30bf\u306e\u4f5c\u6210\u306f\u7d50\u69cb\u6642\u9593\u304b\u304b\u308a\u307e\u3059\u306e\u3067\u3001\u3058\u3063\u3068\u5f85\u3061\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>[bash]<br \/>\ngcloud config set container\/cluster cluster-web3<br \/>\ngcloud container clusters get-credentials cluster-web3<br \/>\n[\/bash]<\/p>\n<p>\u3000\u3053\u306e\u3042\u3068Kubernetes\u3092\u300ckubectl\u300d\u30b3\u30de\u30f3\u30c9\u3067\u64cd\u4f5c\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u3069\u306e\u30af\u30e9\u30b9\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u304b\u3092\u3053\u3053\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002get-credentials\u306f\u306a\u306b\u3059\u308b\u3084\u3064\u3060\u308d?\u300c\u30af\u30e9\u30b9\u30bf\u60c5\u5831\u3092\u30d5\u30a7\u30c3\u30c1\u3059\u308b\u300d\u3068\u8aac\u660e\u304c\u3042\u308b\u304c\u610f\u5473\u4e0d\u660e&#x1f606;<\/p>\n<p>\u3000\u5404\u7a2e\u30b3\u30f3\u30c6\u30ca\u64cd\u4f5c\u3092\u3059\u308b\u305f\u3081\u306bkubectl\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\ngcloud components install kubectl<br \/>\n[\/bash]<\/p>\n<p><a class=\"embedly-card\" href=\"https:\/\/cloud.google.com\/container-engine\/docs\/before-you-begin?hl=ja\">\u958b\u59cb\u65b9\u6cd5<\/a><script async src=\"\/\/cdn.embedly.com\/widgets\/platform.js\" charset=\"UTF-8\"><\/script><\/p>\n<h2>\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u308b<\/h2>\n<p>\u3000Kubernetes\u306f\u30dd\u30c3\u30c9\u3068\u3044\u3046\u5358\u4f4d\u3067\u30b3\u30f3\u30c6\u30ca\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002\u30dd\u30c3\u30c9\u306e\u4e2d\u306b\u306f\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u30bb\u30c3\u30c8\u3067\u304d\u307e\u3059\u3002\u524d\u56de\u4f5c\u3063\u305fNginx\u3068php-fpm\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u4f7f\u3063\u3066\u305d\u308c\u305e\u308c\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3057\u4e00\u3064\u306e\u30dd\u30c3\u30c9\u306b\u5165\u308c\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000\u307e\u305f\u3001\u30dd\u30c3\u30c9\u3067\u3059\u304c\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u30bb\u30c3\u30c8\u3059\u308b\u3053\u3068\u3067\u3001\u30dd\u30c3\u30c9\u306e\u30b3\u30d4\u30fc\u3092\u8907\u6570\u4f5c\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u8ca0\u8377\u306b\u5408\u308f\u305b\u3066\u81ea\u52d5\u7684\u306b\u30dd\u30c3\u30c9\u304c\u5897\u6e1b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000\u5358\u72ec\u3067\u30dd\u30c3\u30c9\u3092\u4f5c\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u4eca\u56de\u306fnginx\u3068php-fpm\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u542b\u3080\u30dd\u30c3\u30c9\u3092\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u30bb\u30c3\u30c8\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u3000\u4ee5\u4e0b\u306eyaml\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u307e\u3059\u3002JSON\u3067\u3082\u6307\u5b9a\u3067\u304d\u307e\u3059\u304c\u3001yaml\u306e\u65b9\u304c\u898b\u3084\u3059\u3044\u3067\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u540d\u306fweb.yml\u3068\u3067\u3082\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<hr \/>\n<p>[yaml]<br \/>\nkind: &quot;ReplicationController&quot;<br \/>\n  apiVersion: &quot;v1&quot;<br \/>\n  metadata:<br \/>\n    name: &quot;web-rc-05&quot;<br \/>\n    labels:<br \/>\n      name: &quot;web-rc-05&quot;<br \/>\n  spec:<br \/>\n    replicas: 1<br \/>\n    selector:<br \/>\n      name: &quot;web-pods&quot;<br \/>\n      version: &quot;5&quot;<br \/>\n    template:<br \/>\n      metadata:<br \/>\n        labels:<br \/>\n          name: &quot;web-pods&quot;<br \/>\n          version: &quot;5&quot;<br \/>\n      spec:<br \/>\n        volumes:<br \/>\n          &#8211; name: www<br \/>\n            nfs:<br \/>\n              server: &quot;db.c.my-project999.internal&quot;<br \/>\n              path: &quot;\/var\/contents&quot;<br \/>\n              readOnly: false<br \/>\n        containers:<br \/>\n          &#8211;<br \/>\n            name: &quot;nginx&quot;<br \/>\n            image: &quot;asia.gcr.io\/my-project999\/nginx:v17&quot;<br \/>\n            resources:<br \/>\n              limits:<br \/>\n                cpu: 100m<br \/>\n              requests:<br \/>\n                cpu: 100m<br \/>\n            ports:<br \/>\n              &#8211;<br \/>\n                containerPort: 80<br \/>\n            volumeMounts:<br \/>\n              &#8211; name: www<br \/>\n                mountPath: &quot;\/var\/contents&quot;<br \/>\n          &#8211;<br \/>\n            name: &quot;php-fpm&quot;<br \/>\n            image: &quot;asia.gcr.io\/my-project999\/php-fpm:v1&quot;<br \/>\n            resources:<br \/>\n              limits:<br \/>\n                cpu: 300m<br \/>\n              requests:<br \/>\n                cpu: 100m<br \/>\n            ports:<br \/>\n              &#8211;<br \/>\n                containerPort: 9000<br \/>\n            volumeMounts:<br \/>\n              &#8211; name: www<br \/>\n                mountPath: &quot;\/var\/contents&quot;<br \/>\n[\/yaml]<\/p>\n<p>\u3000kind\u306b\u306fReplicationController\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002Kubernetes\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306fkind\u3067\u300c\u4f55\u3092\u4f5c\u308b\u304b?\u300d\u3092\u6307\u5b9a\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3000apiVersion\u306fv1\u3067\u3002Kubernetes\u306eAPI\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u3000metadata\u914d\u4e0b\u306ename\u306f\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u540d\u524d\u3067\u3059\u3002<\/p>\n<p>\u3000labels\u306f\u30a4\u30de\u30a4\u30c1\u3088\u304f\u308f\u304b\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u30bb\u30ec\u30af\u30bf\u30fc\u3068\u3044\u3046\u4ed5\u7d44\u307f\u304c\u3042\u3063\u3066\u3053\u3053\u3067\u6307\u5b9a\u3057\u305f\u540d\u524d\u3092\u4f7f\u3063\u3066\u4e00\u62ec\u8a2d\u5b9a\u3057\u305f\u308a\u51fa\u6765\u308b\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>\u3000spec\u914d\u4e0b\u306f\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8a2d\u5b9a\u3067\u3059\u3002replicas\u306f\u3068\u308a\u3042\u3048\u305a\u4e00\u3064\u3067\u3002\u3042\u3068\u3067\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30eb\u8a2d\u5b9a\u3059\u308b\u306e\u3067\u3053\u3053\u306e\u6307\u5b9a\u306f\u3042\u307e\u308a\u610f\u5473\u304c\u7121\u3044\u304b\u3082\u3002<\/p>\n<p>\u3000selector\u3067app: &#8220;web-rc03&#8243;\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3042\u3068\u3067\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3068\u304d\u306b\u3053\u306e\u540d\u524d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u3053\u3089\u3078\u3093\u30a4\u30de\u30a4\u30c1\u79c1\u3082\u3088\u304f\u308f\u304b\u3063\u3066\u306a\u3044\u3002<\/p>\n<p>\u3000template\u914d\u4e0b\u306f\u4f5c\u6210\u3059\u308b\u30dd\u30c3\u30c9\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u3059\u3002volumes\u306e\u3068\u3053\u308d\u3067nfs\u306e\u30de\u30a6\u30f3\u30c8\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002server\u306e\u3068\u3053\u308d\u306fnfs\u30b5\u30fc\u30d0\u30fc\u304c\u52d5\u3044\u3066\u3044\u308b\u30b5\u30fc\u30d0\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000containers\u914d\u4e0b\u306f\u30dd\u30c3\u30c9\u306b\u542b\u3081\u308b\u30b3\u30f3\u30c6\u30ca\u306e\u8a2d\u5b9a\u3067\u3059\u3002image\u306b\u5148\u306b\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30a2\u30c3\u30d7\u3057\u305f\u30a4\u30e1\u30fc\u30b8\u306e\u30bf\u30b0\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3000mountPath\u3067\u30b3\u30f3\u30c6\u30ca\u304c\u52d5\u3044\u3066\u3044\u308b\u30ce\u30fc\u30c9\u306e\u30ed\u30fc\u30ab\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30b3\u30f3\u30c6\u30ca\u306b\u30de\u30a6\u30f3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002\u5148\u306eNFS\u306e\u8a2d\u5b9a\u3067\/var\/contents\u306fNFS\u30b5\u30fc\u30d0\u30fc\u306b\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u7d50\u679cnfs\u30b5\u30fc\u30d0\u30fc\u306e\u5185\u5bb9\u3092\u30b3\u30f3\u30c6\u30ca\u304c\u8aad\u307f\u66f8\u304d\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>NFS\u30b5\u30fc\u30d0\u30fc\u306e\u63a5\u7d9a\u8a31\u53ef<\/h2>\n<p>\u3000NFS\u30b5\u30fc\u30d0\u306e\u65b9\u306b\u3082\u63a5\u7d9a\u8a31\u53ef\u304c\u5fc5\u8981\u3067\u3059\u3002nfs\u30b5\u30fc\u30d0\u30fc\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066<\/p>\n<p>[bash]<br \/>\nvi \/etc\/exports<br \/>\n\/var\/contents gke-cluster-web*.c.my-project999.internal(rw)<br \/>\n[\/bash]<\/p>\n<p>\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u30af\u30e9\u30b9\u30bf\u306e\u30ce\u30fc\u30c9\u540d\u3067\u8a31\u53ef\u3057\u307e\u3059\u3002<\/p>\n<p>\u8a2d\u5b9a\u5909\u66f4\u5f8c\u306f<br \/>\n[bash]<br \/>\nsystemctl restart rpcbind<br \/>\nsystemctl restart nfs-server<br \/>\nsystemctl restart nfs-lock<br \/>\nsystemctl restart nfs-idmap<br \/>\n[\/bash]<br \/>\n\u3067\u30b5\u30fc\u30d3\u30b9\u518d\u8d77\u52d5\u3057\u3066\u8a2d\u5b9a\u53cd\u6620\u3057\u307e\u3059\u3002<\/p>\n<h2>WordPress\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u914d\u7f6e<\/h2>\n<p>nfs\u306e\/var\/contents\/a-tak.com\/html\u914d\u4e0b\u306bwordpress\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u914d\u7f6e\u3057\u307e\u3059\u3002\u8a73\u7d30\u7565\u3067\u3059\u3002<\/p>\n<h2>MariaDB\u306b\u63a5\u7d9a\u8a31\u53ef\u8ffd\u52a0<\/h2>\n<p>\u3000mysql\u30b3\u30de\u30f3\u30c9\u3067MariaDB\u306b\u63a5\u7d9a\u3057\u3066\u30af\u30e9\u30b9\u30bf\u306e\u30ce\u30fc\u30c9\u304b\u3089\u63a5\u7d9a\u8a31\u53ef\u3057\u307e\u3059\u3002IP\u306f\u30af\u30e9\u30b9\u30bf\u4f5c\u6210\u6642\u306b\u6307\u5b9a\u3057\u305fIP\u7bc4\u56f2\u306b\u3057\u307e\u3059\u3002\u3053\u3053\u304c\u6700\u521d\u308f\u304b\u3089\u306a\u304f\u3066\u3060\u3044\u3076\u82e6\u52b4\u3057\u305f\u3002<\/p>\n<p>[bash]<br \/>\ngrant all privileges on wordpress.* to wordpress@&quot;10.212.0.0\/255.252.0.0&quot; identified by &#8216;password&#8217;;<br \/>\nflush privileges;<br \/>\n[\/bash]<\/p>\n<h2>\u3084\u3063\u3068\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<p>\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u304b\u3089kubectl\u30b3\u30de\u30f3\u30c9\u3067\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000\u3055\u3063\u304d\u4f5c\u6210\u3057\u305fweb.yml\u3092\u4f7f\u3044\u307e\u3059\u3002Dropbox\u306edocker\u306e\u4e0b\u306bKubernetes\u30d5\u30a9\u30eb\u30c0\u4f5c\u3063\u3066yaml\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\n#\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<br \/>\ndockerwork=\/Users\/a-tak\/Dropbox\/docker<br \/>\n#\u30d7\u30ed\u30b8\u30a7\u30af\u30c8ID<br \/>\nprojectid=my-project999<br \/>\n#replicateControler\u3092\u4f5c\u6210\u3059\u308b<br \/>\nkubectl create -f ${dockerwork}\/kubernetes\/web.yml<br \/>\n[\/bash]<\/p>\n<p>\u3000\u3053\u308c\u3067\u30b3\u30f3\u30c6\u30ca\u304c\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\nkubectl get pod<br \/>\n[\/bash]<\/p>\n<p>\u3000\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30dd\u30c3\u30c9\u306e\u4f5c\u6210\u72b6\u6cc1\u304c\u308f\u304b\u308a\u307e\u3059\u3002Running\u306b\u306a\u308c\u3070\u8d77\u52d5\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<h2>\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u3063\u3066\u5916\u90e8\u306b\u516c\u958b\u3059\u308b<\/h2>\n<p>Nginx\u3092\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u304b\u3089\u898b\u3048\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u307e\u305fyaml\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u307e\u3059\u3002nginx-service.yml \u3068\u3067\u3082\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<hr \/>\n<p>[yaml]<br \/>\nkind: &quot;Service&quot;<br \/>\n  apiVersion: &quot;v1&quot;<br \/>\n  metadata:<br \/>\n    name: &quot;nginx-svc&quot;<br \/>\n  spec:<br \/>\n    type: &quot;LoadBalancer&quot;<br \/>\n    loadBalancerIP: xxx.xxx.xxx.xxx<br \/>\n    ports:<br \/>\n      &#8211;<br \/>\n        port: 80<br \/>\n    selector:<br \/>\n      name: &quot;web-pods&quot;<br \/>\n[\/yaml]<\/p>\n<p>\u3000\u521d\u56de\u306floadBalancerIP\u306e\u884c\u306f\u6d88\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3000\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3067\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\nkubectl create -f ${dockerwork}\/kubernetes\/nginx-service.yml<br \/>\n[\/bash]<\/p>\n<p>\u3000GKE\u3060\u3068\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u30fc\u3068\u9023\u643a\u3055\u305b\u3066\u7c21\u5358\u306b\u5404\u7a2e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a\u3082\u81ea\u52d5\u3067\u884c\u308f\u308c\u307e\u3059\u3002GCP\u306eWeb\u30b3\u30f3\u30bd\u30fc\u30eb\u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u5916\u90e8IP\u3092\u307f\u308b\u3068\u81ea\u52d5\u3067IP\u304c\u8ffd\u52a0\u3055\u308c\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u30fc\u3068\u7d10\u4ed8\u3051\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u3000\u5916\u90e8IP\u304c\u7d10\u4ed8\u3051\u3089\u308c\u308b\u306e\u306b\u306f1\u5206\u307b\u3069\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067EXTERNAL IP\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>[bash]<br \/>\nkubectl get service<br \/>\n[\/bash]<\/p>\n<p>\u3000\u5916\u90e8\u306b\u3055\u3089\u3059IP\u3092\u56fa\u5b9a\u5316\u3057\u305f\u3044\u5834\u5408\u306f\u3001GCP\u306eWeb\u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u5916\u90e8IP\u30a2\u30c9\u30ec\u30b9\u3067\u300c\u30a8\u30d5\u30a7\u30e1\u30e9\u30eb\u300d\u304b\u3089\u300c\u9759\u7684\u300d\u306b\u5909\u3048\u3066\u3001\u3055\u304d\u307b\u3069\u306eloadBalancerIP\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u3001\u5916\u90e8IP\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000\u3053\u308c\u3067Nginx + PHP-FPM\u306eWordPress\u30b5\u30fc\u30d0\u30fc\u304c\u8d77\u52d5\u3057\u307e\u3059\u3002\u6b21\u56de\u306f\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30eb\u306b\u3064\u3044\u3066\u66f8\u3044\u3066\u307f\u3088\u3046\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p><div id=\"advads-225035023\" class=\"advads-content-placement-after-3rd-paragraph advads-entity-placement\" style=\"margin-left: auto;margin-right: auto;text-align: center;\"><div class=\"advads-adlabel\">\u5e83\u544a<\/div><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-7585646298782746\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:inline-block;width:300px;height:250px;\" \ndata-ad-client=\"ca-pub-7585646298782746\" \ndata-ad-slot=\"6112122906\"><\/ins> \n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u524d\u56de\u307e\u3067\u3067Nginx\u3068php-fpm\u3092\u30d3\u30eb\u30c9\u3057\u3066Google\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30a2\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002\u4eca\u56de\u306fGoogle Container Engine(GKE)\u306e\u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":11633,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28],"tags":[539,565],"class_list":["post-11689","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website","tag-google-compute-engine","tag-google-container-engine"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/a-tak.com\/blog\/wp-content\/uploads\/2016\/02\/gke.jpg?fit=2132%2C1600&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/posts\/11689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/comments?post=11689"}],"version-history":[{"count":0,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/posts\/11689\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/media\/11633"}],"wp:attachment":[{"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/media?parent=11689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/categories?post=11689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/a-tak.com\/blog\/wp-json\/wp\/v2\/tags?post=11689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}