{"id":4251,"date":"2019-05-18T23:57:31","date_gmt":"2019-05-18T14:57:31","guid":{"rendered":"https:\/\/greentown.tokyo\/?p=4251"},"modified":"2019-05-19T00:04:18","modified_gmt":"2019-05-18T15:04:18","slug":"gcpug-joshi-gke","status":"publish","type":"post","link":"https:\/\/greentown.tokyo\/?p=4251","title":{"rendered":"GCPUG\u3055\u3093\u4e3b\u50ac\u306eGKE\u306e\u304a\u52c9\u5f37\u4f1a\u306b\u3044\u3063\u3066\u304d\u307e\u3057\u305f\u4ef6"},"content":{"rendered":"<p>\uff08Kubernetes\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u304c\u5b8c\u5168\u306b\u7d42\u308f\u3063\u3066\u306a\u3044&#8230;\uff09<\/p>\n<p>\u3061\u3087\u3063\u3068\u524d\u306b\u53c2\u52a0\u3057\u305f\u300cGCPUG\u3055\u3093\u4e3b\u50ac\u306eGKE\u306e\u304a\u52c9\u5f37\u4f1a\u306b\u3044\u3063\u3066\u304d\u307e\u3057\u305f\u300d\u306e\u4ef6\u3092\u3088\u3046\u3084\u304f\u66f8\u304d\u7d42\u3048\u305f\u306e\u3067\u3069\u3069\u30fc\u3093\u3068\u6295\u4e0b\u3002<\/p>\n<p>\u4eca\u56de\u306f\u5973\u5b50\u4f1a\u3067\u3057\u305f\u3002GCPUG\u5973\u5b50\u4f1a\u3002<\/p>\n<p>\u5973\u5b50\u301c\u306a\u96c6\u307e\u308a\u306f\u5927\u62b5\u30cb\u30ac\u30c6\u306a\u3093\u3067\u3059\u304c\u3001\u30a8\u30f3\u30b8\u30cb\u30a2\u5973\u5b50\u306e\u96c6\u307e\u308a\u306f\u3001\u306a\u3093\u304b\u3068\u3063\u3066\u3082 \u3086\u308b\u3075\u308f\u306a\u3068\u3053\u308d\u304c\u591a\u304f\u3066\u3001\u884c\u304d\u3084\u3059\u3044\u3068\u611f\u3058\u308b\u4eca\u65e5\u3053\u306e\u9803\u3002<\/p>\n<p>\u3053\u306e\u65e5\u306f<\/p>\n<p>Cloud Ace\u306eGCP\u8a8d\u5b9a\u30c8\u30ec\u30fc\u30ca\u30fc\u3055\u3093\u304c\u8b1b\u5e2b\u3067\u3057\u305f\u3002\uff08\u3042\u3068\u30b5\u30dd\u30fc\u30c8\u306bGoogle\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u3055\u3093\u3068\u304b\u3044\u305f\uff09<\/p>\n<p>\u914d\u5e03\u8cc7\u6599\u304c\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u30e1\u30e2\u3060\u3051\u3002\u30b0\u30b0\u3063\u305f\u30e1\u30e2\u3082\u8ffd\u52a0\u3057\u3066\u307e\u3059\u3002<\/p>\n<h2>GKE\u3068Kubernetes<\/h2>\n<p>Kubernetes\u81ea\u4f53\u306f\u3001GCP\u3060\u308d\u3046\u3068AWS\u3060\u308d\u3046\u3068\u540c\u3058\u301c<\/p>\n<h3>Kubernetes\u306e\u4e16\u754c\u3092\u30a4\u30e1\u30fc\u30b8\u3059\u308b<\/h3>\n<ul>\n<li>\u30de\u30c8\u30ea\u30e7\u30fc\u30b7\u30ab\u306e\u30a4\u30e1\u30fc\u30b8<\/li>\n<li>\u3069\u3093\u3069\u3093\u6f5c\u3063\u3063\u3066\u304f\u30a4\u30e1\u30fc\u30b8<\/li>\n<\/ul>\n<h3>\u7528\u8a9e\u89e3\u8aac<\/h3>\n<h6>\u30af\u30e9\u30b9\u30bf\u30fc<\/h6>\n<ul>\n<li>\u3044\u3061\u3070\u3093\u5916\u5074\u306e\u30cf\u30b3<\/li>\n<\/ul>\n<h6>NodePool<\/h6>\n<ul>\n<li>\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3059\u308b\u305f\u3081\u306e\u3082\u306e<\/li>\n<li>\u3072\u3068\u3064\u306e\u30af\u30e9\u30b9\u30bf\u5185\u3067\u5168\u3066\u304c\u540c\u3058\u3088\u3046\u306b\u69cb\u6210\u3055\u308c\u305f\u30ce\u30fc\u30c9\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30b5\u30d6\u30bb\u30c3\u30c8<\/li>\n<li>\u7279\u5b9a\u306e\u30ce\u30fc\u30c9\u30d7\u30fc\u30eb\u5185\u306e\u30ce\u30fc\u30c9\u306f\u3059\u3079\u3066\u540c\u4e00\u306b\u306a\u308b<\/li>\n<li>default node pool\u3063\u3066\u306a\u3093\u3060\u3063\u3051\uff1f<\/li>\n<li>\u3055\u307e\u3056\u307e\u306a\u30de\u30b7\u30f3\u30bf\u30a4\u30d7\u3092\u4f7f\u7528\u3057\u3066\u3001\u30af\u30e9\u30b9\u30bf\u306b\u30ce\u30fc\u30c9\u30d7\u30fc\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<\/ul>\n<h6>NodePool\u306f\u30b9\u30da\u30c3\u30af\u306b\u3088\u3063\u3066\u5206\u3051\u308b<\/h6>\n<ul>\n<li>Web\u30b5\u30fc\u30d0\u30fc\u306e\u30b9\u30da\u30c3\u30af\u306f\u8efd\u3081\u3067\u3044\u3044<\/li>\n<li>DB\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u3092\u306e\u305b\u308b\u306b\u306f\u3001\u30e1\u30e2\u30ea\u304c\u305f\u304f\u3055\u3093\u3044\u308b\uff08\u30ea\u30c3\u30c1\u30de\u30b7\u30f3\u30bf\u30a4\u30d7\u304c\u5fc5\u8981\uff09<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u8981\u4ef6\u306b\u3088\u3063\u3066\u3001NodePool\u3092\u9078\u629e\u3059\u308b\u3002<\/p>\n<blockquote><p>\u305f\u3068\u3048\u3070\u3001\u30ed\u30fc\u30ab\u30eb SSD\u3001\u6700\u5c0f CPU \u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3001\u30d7\u30ea\u30a8\u30f3\u30d7\u30c6\u30a3\u30d6 VM\u3001\u7279\u5b9a\u306e\u30ce\u30fc\u30c9\u30a4\u30e1\u30fc\u30b8\u3001\u3088\u308a\u5927\u304d\u306a\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 \u30b5\u30a4\u30ba\u3001\u307e\u305f\u306f\u3055\u307e\u3056\u307e\u306a\u30de\u30b7\u30f3\u30bf\u30a4\u30d7\u3092\u4f7f\u7528\u3057\u3066\u3001\u30af\u30e9\u30b9\u30bf\u306b\u30ce\u30fc\u30c9\u30d7\u30fc\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30ab\u30b9\u30bf\u30e0 \u30ce\u30fc\u30c9\u30d7\u30fc\u30eb\u306f\u3001\u4ed6\u3088\u308a\u591a\u304f\u306e\u30ea\u30bd\u30fc\u30b9\uff08\u30e1\u30e2\u30ea\u3084\u30ed\u30fc\u30ab\u30eb \u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u306a\u3069\uff09\u3092\u5fc5\u8981\u3068\u3059\u308b\u30dd\u30c3\u30c9\u3092\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<p style=\"text-align: right;\"><em>Google Cloud\u3088\u308a<\/em><\/p>\n<\/blockquote>\n<h6>Node<\/h6>\n<ul>\n<li>VM\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u3053\u3068<\/li>\n<li>Node\u306fVM\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u8d77\u52d5\u3057\u3066\u3044\u308b<\/li>\n<li>NodePool\u306b\u3042\u308bNode\uff08GCE VM\uff09\u306f\u8907\u6570\u306e\u30be\u30fc\u30f3\u306b\u307e\u305f\u304c\u3063\u3066\u914d\u7f6e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<\/ul>\n<h6>\u305d\u306e\u4ed6\u30e1\u30e2<\/h6>\n<ul>\n<li>\u672c\u756a\u3067\u904b\u7528\u3059\u308b\u306e\u3001\u3051\u3063\u3053\u3046\u5927\u5909\u3067\u3059<\/li>\n<\/ul>\n<h2>\u3053\u3053\u304b\u3089\u30af\u30fc\u30d0\u306e\u8a71<\/h2>\n<p>\u3063\u3066\u8a00\u3063\u3066\u305f\u3002<\/p>\n<p>Kubernetes\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306bNode\u306e\u8a71\u306f\u51fa\u3066\u304d\u305f\u3051\u3069\u3001NodePool\u306f\u51fa\u3066\u3053\u306a\u304b\u3063\u305f\u3002\u3002GKE\u306e\u6a5f\u80fd\u306a\u306e\u304b\u306a\u3002<\/p>\n<h3>Pod<\/h3>\n<ul>\n<li>Node\u306e\u4e2d\u306bPod\u304c\u3042\u308b<\/li>\n<li><span style=\"color: #ff0000;\"><strong>\u3072\u3068\u3064\u306ePod\u304c\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3067\u304d\u308b<\/strong><\/span><\/li>\n<li>Kubernetes\u306e\u30b9\u30b1\u30fc\u30eb\u306fPod\u5358\u4f4d\u3067\u304a\u3053\u306a\u308f\u308c\u308b<\/li>\n<li>Pod\u306e\u8a2d\u8a08\u306fyml\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8f09\u3059\u308b<\/li>\n<li>\u8a2d\u8a08\u56f3\u306b\u306f\u3044\u304f\u3064\u304b\u7a2e\u985e\u304c\u3042\u308b<\/li>\n<li>Pod\u3092\u4f5c\u308b\u306e\u304cKuber\u306e\u4ed5\u4e8b<\/li>\n<\/ul>\n<h3>Service<\/h3>\n<ul>\n<li>Pod\u306b\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u6d41\u3059<\/li>\n<li>\u30e6\u30fc\u30b6\u30fc\u304c\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304d\u305f\u3089\u3001Pod\u306b\u3064\u306a\u3050<\/li>\n<\/ul>\n<h6>\u3069\u3046\u3084\u3063\u3066\u30b5\u30fc\u30d3\u30b9\u3092\u53d7\u3051\u4ed8\u3051\u3001Pod\u3068\u30b5\u30fc\u30d3\u30b9\u3092\u7d10\u3065\u3051\u308b\u304b<\/h6>\n<ul>\n<li>Ingress -&gt; Service \u2192 Pod<\/li>\n<\/ul>\n<p>hoge.com\/a<\/p>\n<p>\u2193 \u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u30fc\u306e\u5916\u90e8IP\u306b\u5bfe\u3057\u3066\u30a2\u30af\u30bb\u30b9<\/p>\n<p><span style=\"color: #0000ff;\"><strong>Ingress\uff08= GCP\u306eHTTPLB\u304c\u8d77\u52d5\u3057\u3066\u3044\u308b\uff09<\/strong><\/span><\/p>\n<p>\u2193<\/p>\n<p>ServiceA \u00a0\/ ServiceB \uff08<span style=\"color: #0000ff;\"><strong>NodePort<\/strong><\/span>, LB\uff09<\/p>\n<p>ServiceA<\/p>\n<p>\u2193<\/p>\n<p>PodA \/ PodA<\/p>\n<p>ServiceB<\/p>\n<p>\u2193<\/p>\n<p>PodB \/ PodB \/ PodB<\/p>\n<h3>Pod\u3092\u4f5c\u308b\u306e\u306b\u5fc5\u8981\u306a\u3082\u306e<\/h3>\n<h6>ReplicaSet<\/h6>\n<ul>\n<li>\u540c\u3058\u5b9a\u7fa9\u306e\u8907\u6570\u306ePod\u3092\u4f5c\u6210\u3057\u5206\u6563\u306b\u5099\u3048\u308b<\/li>\n<\/ul>\n<h6>Deployment<\/h6>\n<ul>\n<li>ReplicaSet\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u304c\u3064\u3044\u305f\u3082\u306e<\/li>\n<li>RollingUpdate\u3057\u305f\u5f8c\u306b\u5143\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u623b\u3059\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<\/ul>\n<h6>StatefulSet<\/h6>\n<ul>\n<li>\u5206\u6563\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306a\u3069\u306e\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb\u306a\u30b3\u30f3\u30c6\u30ca\u306b\u4f7f\u7528\u3059\u308b<\/li>\n<li>Pod\u306b\u5bfe\u3057\u3066\u6c38\u7d9a\u30c7\u30a3\u30b9\u30af\u304c\u5272\u308a\u5f53\u3066\u3089\u308c\u308b\uff08\u30e2\u30f3\u30b4\u3061\u3083\u3093\u3068\u304b\u3001\u30ab\u30b5\u30f3\u30c9\u30e9\u3061\u3083\u3093 \u3068\u304b\uff09<\/li>\n<\/ul>\n<h2>NodePort\u3092\u30e1\u30a4\u30f3\u306b\u304a\u52c9\u5f37\u3059\u308b<\/h2>\n<p>\u30cf\u30f3\u30ba\u30aa\u30f3\u4e2d\u306a\u3045<\/p>\n<p>\u30e1\u30e2<\/p>\n<ul>\n<li>\uff11\u3064\u306e\u30be\u30fc\u30f3\u306b\u3064\u304d\u4f55\u500b\u306e\u30ce\u30fc\u30c9\u3092\u8d77\u52d5\u3059\u308b\u304b\u30aa\u30d7\u30b7\u30e7\u30f3<\/li>\n<li>NUM_NODES<\/li>\n<\/ul>\n<h6>preemptible\uff08\u30d7\u30ea\u30a8\u30f3\u30d7\u30c6\u30a3\u30d6\uff09\u30aa\u30d7\u30b7\u30e7\u30f3<\/h6>\n<ul>\n<li>\u958b\u767a\u3059\u308b\u3068\u304d\u306b\u306b\u5b89\u304fGCP\u304c\u5229\u7528\u3067\u304d\u308b<\/li>\n<li>24\u6642\u9593\u4ee5\u5185\u306b\u30b9\u30c8\u30c3\u30d7\u3059\u308bGCP\u306e\u30aa\u30d7\u30b7\u30e7\u30f3<\/li>\n<li>\u6771\u4eac\uff17\u5272\u5f15\u306e\u5024\u6bb5\u3067\u4f7f\u3048\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\uff1f<\/li>\n<li>GKE\u3067preemptible\u3057\u3066\u3082\u6d88\u3048\u306a\u3044\uff08\u672c\u756a\u3067\u306f\u4f7f\u308f\u306a\u3044\u3053\u3068\uff09<\/li>\n<\/ul>\n<p>yaml\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3057\u306a\u304c\u3089\u3001\u6d41\u308c\u3092\u30c1\u30a7\u30c3\u30af\uff08\u3053\u3053\u304b\u3089\u3001\u4ed6\u4eba\u304c\u8aad\u3093\u3067\u3082\u308f\u304b\u3089\u3093\u304b\u3082\u30fb\u30fb\u81ea\u5206\u30e1\u30e2\uff09<\/p>\n<ul>\n<li>kubectl apply -f nginx.yaml<\/li>\n<\/ul>\n<h3>Pod\u3092\u4f5c\u308b\u8a2d\u5b9a\u56f3<\/h3>\n<h6>deployment.yml<\/h6>\n<pre class=\"lang:default decode:true\">apiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: nginx\r\nspec:\r\n  replicas: 3 \u2190\u91cd\u8981\uff08\u30ec\u30d7\u30ea\u30ab\u6570\uff09\r\n  selector:\r\n    matchLabels:\r\n      app: nginx \u2190\u2605\u4e00\u81f4\u3055\u305b\u308b\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: nginx \u2190\u2605\u4e00\u81f4\u3055\u305b\u308b\r\n    spec:\r\n      containers:\r\n      - name: nginx\r\n        image: nginx:stable-alpine\r\n        ports:\r\n        - containerPort: 80\r\n        readinessProbe:\r\n          initialDelaySeconds: 30\r\n          httpGet:\r\n            path: \/\r\n            port: 80\r\n        livenessProbe:\r\n          periodSeconds: 60\r\n          httpGet:\r\n            path: \/\r\n            port: 80\r\n        resources:\r\n          requests:\r\n            cpu: 200m\r\n            memory: 100Mi\r\n          limits:\r\n            cpu: 200m\r\n            memory: 100Mi\r\n<\/pre>\n<p>\u2605\u307b\u3057\u306e\u90e8\u5206\u3001\u3069\u306e\u30e9\u30d9\u30eb\u3092\u6301\u3063\u305fPod\u3092\u81ea\u5206\u306e\u30ec\u30d7\u30ea\u30ab\u3068\u3057\u3066\u3082\u3064\u306e\u304b<\/p>\n<ul>\n<li>\u3069\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u3046\u304b\u3092\u00a0<strong>containers:<\/strong> \u306e\u3068\u3053\u308d\u306b\u304b\u304f<\/li>\n<li><span style=\"color: #0000ff;\"><strong>Yaml\u306e\u30cf\u30a4\u30d5\u30f3\u306f\u914d\u5217\u3092\u8868\u3057\u3066\u308b\uff01\uff01\uff08\u77e5\u3089\u3093\u304b\u3063\u305f\uff01\uff09<\/strong><\/span><\/li>\n<\/ul>\n<pre class=\"theme:dark-terminal lang:default decode:true\"> - name: nginx \u540d\u524d\u306f\u306a\u3093\u3067\u3082\u3044\u3044\r\n    Image: nginx:stable-alpine   \u2190\u30bf\u30b0 DockerHub\u306b\u3042\u308bnginx\u306e\u7a2e\u985e alpine\u3063\u3066\u3044\u3046\uff08\u30a2\u30eb\u30d1\u30a4\u30f3\uff09\u5358\u8a9e\uff08\u30bf\u30b0\uff09\u3092\u899a\u3048\u3066\u304a\u304f\u3068\u3044\u3044<\/pre>\n<ul>\n<li>Image \u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8<\/li>\n<\/ul>\n<h6>\u30a2\u30eb\u30d1\u30a4\u30f3<\/h6>\n<ul>\n<li>\u8efd\u91cf\u306aOS\u306e\u30a4\u30e1\u30fc\u30b8<\/li>\n<li>\u3068\u3063\u3066\u3082\u8efd\u304f\u3066\u30b9\u30b1\u30fc\u30eb\u3057\u3084\u3059\u3044<\/li>\n<li><span style=\"color: #ff0000;\"><strong><span style=\"font-size: 150%;\">\u30b3\u30f3\u30c6\u30ca\u306f\u8efd\u3055\u304c\u6b63\u7fa9<\/span><\/strong><\/span><\/li>\n<li>\u30a2\u30eb\u30d1\u30a4\u30f3\u3092\u30a4\u30e1\u30fc\u30b8\u3057\u3066web\u30b5\u30fc\u30d0\u30fc\u3092\u4f5c\u308c\u3070\u3044\u3044<\/li>\n<li>\u30a2\u30eb\u30d1\u30a4\u30f3\u306f\u30b3\u30f3\u30c6\u30ca\u4f1a\u306e\u5e38\u8b58\u3089\u3057\u3044<\/li>\n<\/ul>\n<h6>readinessProbe<\/h6>\n<pre class=\"theme:dark-terminal lang:default decode:true\">readinessProbe:30 \u219030\u79d2<\/pre>\n<ul>\n<li>\u30ec\u30c7\u30a3\u30cd\u30b9\u30d7\u30ed\u30fc\u30d6<\/li>\n<li>\u30d8\u30eb\u30b9\u30c1\u30a7\u30c3\u30af<\/li>\n<li>\u6e96\u5099\u72b6\u614b\u3092\u4fdd\u8a3c<\/li>\n<li>\u305d\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u3001\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u6d41\u3057\u3066\u3082\u5927\u4e08\u592b\u3067\u3059\u304b\uff1f\u3068\u304b\u3057\u3066\u304f\u308c\u308b<\/li>\n<li>\u6700\u521d\u306b30\u79d2\u5f85\u3063\u305f\u5f8c\u306b\u3001Get\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u30eb\u30fc\u30c8\u30d1\u30b9\u306e80\u756a\u306b\u6d41\u3059\uff08yaml\u30d5\u30a1\u30a4\u30eb\u306b80\u756a\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u305f\u3089\uff09<\/li>\n<li>\u6b63\u5e38\u306b\u5e30\u3063\u3066\u3053\u306a\u304b\u3063\u305f\u3089\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6d41\u3055\u306a\u3044\u3067\u304f\u308c\u308b<\/li>\n<\/ul>\n<h6>livenessProbe<\/h6>\n<pre class=\"theme:dark-terminal lang:default decode:true \">livenessProbe:<\/pre>\n<ul>\n<li>\u751f\u304d\u3066\u307e\u3059\u304b\uff1f<\/li>\n<li>\u30b3\u30f3\u30c6\u30ca\u304c\u304a\u4ea1\u304f\u306a\u308a\u306a\u3063\u305f\u3089\u30b3\u30f3\u30c6\u30ca\u3092\u518d\u8d77\u52d5\u3057\u3066\u304f\u308c\u308b<\/li>\n<li>\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306e\u554f\u984c\u304c\u3042\u3063\u3066\u3082\u30b3\u30f3\u30c6\u30ca\u3092\u81ea\u52d5\u8d77\u52d5\u3057\u3066\u304f\u308c\u308b<\/li>\n<\/ul>\n<h6>Resource<\/h6>\n<ul>\n<li>\u30b3\u30f3\u30c6\u30ca\u304c\u3069\u3053\u307e\u3067\u30ea\u30bd\u30fc\u30b9\u304c\u5fc5\u8981\u3067\u3001\u3069\u3053\u307e\u3067\u4f7f\u3063\u3066\u3044\u3044\u304b\u3092\u3057\u3066\u3044\u3044\u304b\u6307\u5b9a\u3059\u308b<\/li>\n<\/ul>\n<h6>\u305d\u306e\u307b\u304b<\/h6>\n<p>Requests\u3068limits\u3092\u4f7f\u3063\u3066\u3001\u30ea\u30bd\u30fc\u30b9\u3092\u78ba\u4fdd\u3059\u308b\u3001\u30ce\u30fc\u30c9\u30d7\u30fc\u30eb\u306e\u30b9\u30da\u30c3\u30af\u3092\u6c7a\u3081\u308b\u3001\u30ce\u30fc\u30c9\u6570\u3092\u6c7a\u3081\u308b\uff1f<\/p>\n<p>\u3053\u3053\u307e\u3067\u304c\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u306e\u304a\u8a71<\/p>\n<p>&nbsp;<\/p>\n<h6>service.yaml<\/h6>\n<pre class=\"lang:default decode:true\" title=\"service.yml\">apiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: nginx-svc\r\nspec:\r\n  type: NodePort \u2190\u3053\u306ePod\u3092\u62c5\u5f53\u3057\u305f\u3044\uff1f\uff1f\r\n  selector:\r\n    app: nginx\r\n  ports:\r\n  - port: 80\r\n    targetPort: 80<\/pre>\n<h6><\/h6>\n<h6>ingress.yml<\/h6>\n<pre class=\"theme:dark-terminal lang:default decode:true\">apiVersion: extensions\/v1beta1\r\nkind: Ingress\r\nmetadata:\r\n  name: nginx-ingress\r\nspec:\r\n  rules:\r\n  - http:\r\n      paths:\r\n      - backend:\r\n          serviceName: nginx-svc \u2190\u30b3\u30b3\u2605\r\n          servicePort: 80\r\n<\/pre>\n<ul>\n<li>\u3053\u306e\u30a4\u30f3\u30b0\u30ec\u30b9\u306b\u5230\u9054\u3059\u308b\u3059\u3079\u3066\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306finginx-svc\u2605\u306e80\u756a\u306b\u6d41\u3059<\/li>\n<li>Pod\u306e80\u756a\u306b\u6d41\u3059\uff08container port80\u3078\u6d41\u3059\uff09<\/li>\n<li>\u30a4\u30f3\u30b0\u30ec\u30b9\u306fIP\u30a2\u30c9\u30ec\u30b9\u3092\u3082\u3063\u3066\u3044\u308b<\/li>\n<\/ul>\n<p>\u30e1\u30e2<\/p>\n<ul>\n<li>Kubectl\uff08\u30ad\u30e5\u30fc\u30d6\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\uff09<\/li>\n<li>\u81ea\u52d5\u30b9\u30b1\u30fc\u30eb<\/li>\n<li>\u6c34\u5e73Pod\u30b9\u30b1\u30fc\u30eb<\/li>\n<li>Horizontal pod autoscaler\uff08\u30e6\u30fc\u30b6\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u6570\u306b\u5fdc\u3058\u3066\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30eb\u304c\u3067\u304d\u308b\uff09<\/li>\n<\/ul>\n<p>\u6700\u521d\u306e\u52c9\u5f37\u306f\u96e3\u3057\u3044\u672c\u3092\u8aad\u3080\u3088\u308a\u3001Nodeport\u3001Ingres\u3001\u3069\u3046\u3086\u3046yaml\u3092\u66f8\u3044\u305f\u3089\u52d5\u304f\uff1f\u3063\u3066\u66f8\u3044\u3066\u3084\u3063\u305f\u307b\u3046\u304c\u826f\u3044\u3002\u6982\u5ff5\u306f\u3042\u3068\u306b\u3057\u3066\u3001\u4f5c\u308a\u305f\u3044\u3082\u306e\u3092\u3001\u307e\u305ayaml\u30d5\u30a1\u30a4\u30eb\u66f8\u3044\u3066\u52d5\u304b\u3059\u3079\u3057\u3002<\/p>\n<p>Go\u3067\u66f8\u3044\u305fAPI\u30b5\u30fc\u30d0\u30fc\u3092\u30af\u30fc\u30d0\u3067\u3069\u3046\u52d5\u304b\u3057\u305f\u3089\u3044\u3044\u3093\u3060\u308d\u3046\uff1f\u3063\u3066\u8003\u3048\u3066\u307f\u308b\u3068\u304b<\/p>\n<ul>\n<li>\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\u306f\u3001Pod\u304c\u6700\u5c0f\u5358\u4f4d<\/li>\n<li>\u4f8b\u3048\u3070\u3001DB\u3068\u305d\u306e\u72b6\u614b\u3092\u76e3\u8996\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u3084\u3001AP\u30b5\u30fc\u30d0\u3068\u3001HTTPS\u306e\u672b\u7aef\u3068\u306a\u308bNGINX\u306a\u3069<\/li>\n<li>Pod\u5185\u306b\u306fPrivate\u306a\u4eee\u60f3IP\u304c\u632f\u3089\u308c\u3066\u304a\u308a\u3001Pod\u5185\u306e\u30b3\u30f3\u30c6\u30ca\u306f\u3001localhost\u3067\u901a\u4fe1\u3059\u308b<\/li>\n<\/ul>\n<p>&#8212;<\/p>\n<p>Pod\u306e\u4f5c\u6210\u306e\u4ed5\u65b9\u306b\u306f\u4e8c\u7a2e\u985e\u3042\u308a\u3001AP\u7cfb\uff08\u57fa\u672c\u7cfb\uff09\u3068\u3001DB\u7cfb\u304c\u3042\u308b<\/p>\n<p>AP\u7cfb\u306f<\/p>\n<ul>\n<li>Deployment\u2192Replicaset\u2192Pod<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u9806\u3067\u5b9a\u7fa9\u3002Replicaset\u306f\u540c\u4e00\u306ePod\u3092n\u500b\u4f5c\u6210\u3059\u308b\u70ba\u306e\u3082\u306e\u3067\u3001Deployment\u306fReplicaset\u3068\u307b\u307c\u540c\u69d8\u3060\u3051\u3069\u3001\u6562\u3048\u3066Deployment\u306b\u3059\u308b\u4e8b\u3067\u3001\u30ed\u30fc\u30ea\u30f3\u30b0\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u53ef\u80fd\u306b\u306a\u308b\u3002<\/p>\n<p>\u76f4\u63a5Pod\u3092\u4f5c\u6210\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001Deploymet\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3084\u30ed\u30fc\u30ea\u30f3\u30b0\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3001\u8a2d\u5b9a\u306b\u3088\u3063\u3066\u306f\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3082\u53ef\u80fd\u306b\u306a\u308b\u3002<\/p>\n<p>\u3042\u3068\u3001\u81ea\u5206\u304c\u6240\u5c5e\u3057\u3066\u3044\u308bTech\u7cfbNPO\u306e\u30e1\u30f3\u30d0\u30fc\u3067\u3001\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u8d77\u696d\u306a\u3045\u306aKubernetes\u731b\u52c9\u4e2d\u306e\u82e5\u8005\u306b\u8272\u3005\u6559\u3048\u3066\u3082\u3089\u3063\u305f\u3002\u3002<\/p>\n<p>\u3069\u3093\u3069\u3093\u89e6\u3063\u3066\u3044\u304b\u306a\u3044\u3068\u308f\u304b\u3089\u3093\u306a\u3041\u301c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uff08Kubernetes\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u304c\u5b8c\u5168\u306b\u7d42\u308f\u3063\u3066\u306a\u3044&#8230;\uff09 \u3061\u3087\u3063\u3068\u524d\u306b\u53c2\u52a0\u3057\u305f\u300cGCPUG\u3055\u3093\u4e3b\u50ac\u306eGKE\u306e\u304a\u52c9\u5f37\u4f1a\u306b\u3044\u3063\u3066\u304d\u307e\u3057\u305f\u300d\u306e\u4ef6\u3092\u3088\u3046\u3084\u304f\u66f8\u304d\u7d42\u3048\u305f\u306e\u3067\u3069\u3069\u30fc\u3093\u3068\u6295\u4e0b\u3002 \u4eca &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4253,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[98,101],"tags":[],"class_list":["post-4251","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-container","category-gcp"],"_links":{"self":[{"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/posts\/4251"}],"collection":[{"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4251"}],"version-history":[{"count":18,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/posts\/4251\/revisions"}],"predecessor-version":[{"id":4279,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/posts\/4251\/revisions\/4279"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=\/wp\/v2\/media\/4253"}],"wp:attachment":[{"href":"https:\/\/greentown.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greentown.tokyo\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}