{"id":35558,"date":"2023-11-10T11:51:27","date_gmt":"2023-08-28T05:37:40","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/"},"modified":"2024-05-04T08:19:56","modified_gmt":"2024-05-04T00:19:56","slug":"%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/","title":{"rendered":"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8(\u4e0b\u7bc7)"},"content":{"rendered":"<p>\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8\uff08\u4e0a\uff09\u7684\u7eed\u7bc7\u3002<\/p>\n<p>\u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u7684\u7ed3\u5c3e\u5904\uff0c\u63d0\u5230\u4e86\u4ee5\u4e0b\u7684\u5185\u5bb9\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30a2\u30d7\u30ea\u3068\u30b5\u30fc\u30d0\u30fc\u304c\u5bc6\u7d50\u5408<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u30a2\u30d7\u30ea\u3068\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u30fc\u304c\u5bc6\u7d50\u5408<\/ul>\n<p>\u63ed\u793a\u8fd9\u4e9b\u95ee\u9898\uff0c\u5e76\u5c06\u5176\u4e0e\u5bb9\u5668\u3001\u5bb9\u5668\u7f16\u6392\u5668\u4ee5\u53ca\u57fa\u7840\u8bbe\u65bd\u5373\u4ee3\u7801\uff08IaC\uff09\u7684\u8bdd\u9898\u8054\u7cfb\u8d77\u6765\u3002<\/p>\n<h1>\u76f4\u63a5\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u548c\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u7684\u6311\u6218<\/h1>\n<p>\u8003\u8651\u5c06\u5e94\u7528\u7a0b\u5e8f\u90e8\u7f72\u5728\u670d\u52a1\u5668\u4e0a\u3002\u4f8b\u5982\uff0c\u8003\u8651\u4f7f\u7528 AWS \u7684 EC2 \u6216\u8005\u79df\u7528\u6a31\u82b1\u7684 VPS \u670d\u52a1\u5668\u3002<\/p>\n<p>\u5982\u4f55\u5728\u670d\u52a1\u5668\u4e0a\u5177\u4f53\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\uff1f<\/p>\n<p>\u5728\u670d\u52a1\u5668\u4e0a\u5b9e\u73b0\u7684\u65b9\u6cd5\u4e0e\u672c\u5730\u8fd0\u884c\u7684\u65b9\u6cd5\u76f8\u540c\u662f\u73b0\u5728\u9996\u5148\u8003\u8651\u5230\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u6bd4\u5982\u8bf4\uff0c\u4ee5 Python \u4e3a\u4f8b\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u7136\u308b\u3079\u304d Python \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30b5\u30fc\u30d0\u30fc\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u7136\u308b\u3079\u304d\u30e9\u30a4\u30d6\u30e9\u30ea\u3092 pip install -r requirements.txt \u306a\u3069\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/ul>\n<\/li>\n<\/ul>\n<p>python main.py \u306a\u3069\u3092\u5b9f\u884c\u3057\u3066\u52d5\u304b\u3059<\/p>\n<p>\u9700\u8981\u6700\u5c11\u7684\u5de5\u4f5c\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a\u5e76\u4e0d\u4ec5\u4ec5\u5982\u6b64\u3002\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u8fd8\u9700\u8981\u6839\u636e\u9700\u8981\u4fee\u6539\u670d\u52a1\u5668\u7684\u8bbe\u7f6e\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306b\u30ed\u30b0\u3092\u66f8\u304d\u51fa\u3057\u7d9a\u3051\u308b\u3068\u30c7\u30a3\u30b9\u30af\u304c\u903c\u8feb\u3059\u308b\u306e\u3067\u3001\u30ed\u30b0\u30ed\u30fc\u30c6\u30fc\u30c8\u3092\u6b63\u3057\u304f\u30bb\u30c3\u30c8\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u3089\u308c\u308b\u3088\u3046\u306b\u3001\u7279\u5b9a\u306e\u30dd\u30fc\u30c8\u3092\u958b\u304f\u3002\u30b5\u30fc\u30d0\u30fc\u306b\u4fb5\u5165\u3055\u308c\u3066\u306f\u56f0\u308b\u306e\u3067\u305d\u308c\u4ee5\u5916\u306f\u9589\u3058\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u3066\u6b63\u3057\u304f\u8fd4\u305b\u308b\u3088\u3046\u306b\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u8a2d\u5b9a\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">&#8230;<\/ul>\n<p>\u8fd9\u6837\u4e00\u6765\uff0c\u5c31\u80fd\u591f\u5148\u8ba9\u5b83\u8fd0\u52a8\u8d77\u6765\u4e86\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u8fd9\u91cc\u5b58\u5728\u7740\u4ee5\u4e0b\u8fd9\u6837\u7684\u95ee\u9898\u3002<\/p>\n<p>\u8907\u96d1\u306a\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3068\u7ba1\u7406:<\/p>\n<p>\u3068\u306b\u304b\u304f\u3060\u308b\u3044\u3002\u524d\u306e\u8a18\u4e8b\u3067\u8aac\u660e\u3057\u305f\u901a\u308a\u3001\u4e0a\u306b\u793a\u3057\u305f\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u304c\u5fc5\u8981\u306a\u30b5\u30fc\u30d0\u30fc\u306f1\u53f0\u3067\u306f\u306a\u3044\u3002\u3053\u308c\u3092\u4f55\u5ea6\u3082\u7e70\u308a\u8fd4\u3059\u305f\u3081\u306b \u91cd\u539a\u306a\u624b\u9806\u66f8 \u3092\u5fc5\u8981\u3068\u3059\u308b\u3002\u307e\u305f\u30b9\u30c6\u30c3\u30d7\u6570\u304c\u591a\u3044\u3068\u305d\u308c\u3060\u3051\u6642\u9593\u3082\u304b\u304b\u308b\u3057\u3001\u9593\u9055\u3044\u3082\u8d77\u304d\u3084\u3059\u3044\u3002\u305d\u308c\u3092\u9593\u9055\u3048\u305a\u3001\u8fc5\u901f\u306b\u9ed9\u3005\u3068\u884c\u3046\u5c02\u4efb\u306e \u30a4\u30f3\u30d5\u30e9\u8077\u4eba \u3092\u5fc5\u8981\u3068\u3059\u308b\u3002\u3082\u3061\u308d\u3093\u63f6\u63c4\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u74b0\u5883\u4f9d\u5b58\u6027\u3068\u4e92\u63db\u6027\u306e\u554f\u984c:<\/p>\n<p>\u3044\u308f\u3086\u308b \u300c\u30ed\u30fc\u30ab\u30eb\u3067\u306f\u52d5\u3044\u3066\u3044\u305f\u3093\u3067\u3059\u3051\u3069\u306d\u300d\u554f\u984c \u3002\u30ed\u30fc\u30ab\u30eb\u306e\u958b\u767a\u74b0\u5883\u3067\u306f\u52d5\u3044\u3066\u3044\u305f\u3051\u3069\u3001\u672c\u756a\u74b0\u5883\u3060\u3068\u9014\u7aef\u306b\u52d5\u304b\u306a\u304f\u306a\u308b\u3002\u7406\u7531\u306f\u69d8\u3005\u3067\u3001\u4f8b\u3048\u3070\u30ed\u30fc\u30ab\u30eb\u306e Mac \u3060\u3068\u52d5\u304f\u3051\u3069 Debian \u30d9\u30fc\u30b9\u306e\u30b5\u30fc\u30d0\u30fc\u74b0\u5883\u3060\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u4f9d\u5b58\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u5fae\u5999\u306b\u5dee\u7570\u304c\u3042\u3063\u3066\u52d5\u304b\u306a\u3044\u3068\u304b\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u304c\u30ed\u30fc\u30ab\u30eb\u3068\u9055\u3046\u304b\u3089\u3001\u3060\u3068\u304b\u3002\u3053\u3046\u3044\u3046\u3057\u3087\u30fc\u3082\u306a\u3044\u5dee\u7570\u306f\u7d50\u69cb\u30b9\u30c8\u30ec\u30b9\u3002<\/p>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3068\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4f9d\u5b58\u95a2\u4fc2:<\/p>\n<p>\u4e00\u822c\u306b\u30b5\u30fc\u30d0\u30fc\u306e\u30b9\u30da\u30c3\u30af\u306f\u9ad8\u304f\u3066\u3001\u30e1\u30e2\u30ea\u306f 64 GB \u3068\u304b\u666e\u901a\u306b\u3042\u308b\u3002\u3057\u305f\u304c\u3063\u3066\u3001 \u8907\u6570\u306e\u30a2\u30d7\u30ea\u3092\u4e00\u53f0\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u540c\u5c45\u3055\u305b\u308b\u3053\u3068\u3082\u5e38\u3002\u3053\u306e\u3068\u304d\u3001\u4f8b\u3048\u30702\u3064\u306e\u7570\u306a\u308b Python \u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u540c\u6642\u306b\u540c\u3058\u30b5\u30fc\u30d0\u30fc\u3067\u52d5\u304b\u305d\u3046\u3068\u3057\u305f\u3068\u304d\u306b\u3001\u4e00\u65b9\u306e\u30a2\u30d7\u30ea\u306f\u30e9\u30a4\u30d6\u30e9\u30ea\u306e version 1.0 \u3092\u5fc5\u8981\u3068\u3059\u308b\u3051\u3069\u3001\u3082\u3046\u4e00\u65b9\u306e\u3084\u3064\u306f\u540c\u3058\u30e9\u30a4\u30d6\u30e9\u30ea\u306e version 0.9 \u3092\u5fc5\u8981\u3068\u3059\u308b\u3001\u3068\u3044\u3063\u305f\u3068\u304d\u306b\u3001\u660e\u3089\u304b\u306b\u3081\u3093\u3069\u304f\u3055\u3044\u30022\u3064\u306e\u30a2\u30d7\u30ea\u304c\u3001\u540c\u3058\u30b5\u30fc\u30d0\u30fc\u306b\u52d5\u3044\u3066\u3044\u308b\u3068\u3044\u3046\u3060\u3051\u3067 \u5bc6\u7d50\u5408 \u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u30ea\u30bd\u30fc\u30b9\u306e\u885d\u7a81\u3068\u5206\u96e2:<\/p>\n<p>\u8907\u6570\u306e\u30a2\u30d7\u30ea\u304c\u540c\u3058\u30b5\u30fc\u30d0\u30fc\u3067\u5b9f\u884c\u3055\u308c\u308b\u5834\u5408\u3001 CPU \u3084\u30e1\u30e2\u30ea\u3001\u30c7\u30a3\u30b9\u30af\u30b9\u30da\u30fc\u30b9\u306a\u3069\u306e\u30ea\u30bd\u30fc\u30b9\u306e\u7af6\u5408\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3002\u4f8b\u3048\u3070\u4e00\u3064\u306e\u30a2\u30d7\u30ea\u306b\u30d0\u30b0\u304c\u3042\u3063\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u306e\u30e1\u30e2\u30ea\u3092\u5168\u90e8\u4f7f\u3044\u679c\u305f\u3059\u81ea\u4f53\u306b\u306a\u308c\u3070\u3001\u305d\u308c\u304c\u539f\u56e0\u3067\u540c\u5c45\u3057\u3066\u3044\u308b\u5225\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3082\u52d5\u304b\u306a\u3044\u3001\u3068\u3044\u3046\u5225\u306e\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u3002\u3053\u308c\u3082\u30a2\u30d7\u30ea\u540c\u58eb\u304c \u5bc6\u7d50\u5408 \u306b\u306a\u3063\u3066\u3044\u308b\u4f8b\u3060\u3002<\/p>\n<p>\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u7684\u65b9\u6cd5\uff0c\u4e00\u76f4\u4ee5\u6765\u90fd\u63d0\u4f9b\u4e86\u4e00\u4e9b\u3002\u5373\u6240\u8c13\u7684\u865a\u62df\u5316\u6280\u672f\u3002<\/p>\n<p>\u4f5c\u4e3a\u6267\u884cJava\u7684\u73af\u5883\uff0cJVM\uff08Java\u865a\u62df\u673a\uff09\u548cGraalVM\u662f\u8457\u540d\u7684\u865a\u62df\u5316\u6280\u672f\u4e4b\u4e00\u3002\u901a\u8fc7\u5c06JVM\u63d2\u5165\u5e94\u7528\u7a0b\u5e8f\u548c\u64cd\u4f5c\u7cfb\u7edf\u4e4b\u95f4\uff0c\u53ef\u4ee5\u9632\u6b62\u64cd\u4f5c\u7cfb\u7edf\u4e0e\u5e94\u7528\u7a0b\u5e8f\u4e4b\u95f4\u7684\u7d27\u5bc6\u8026\u5408\u3002<\/p>\n<p>Python\u548cRuby\u4e5f\u662f\u4e00\u79cd\u865a\u62df\u5316\u6280\u672f\uff0c\u901a\u8fc7\u903b\u8f91\u4e0a\u9694\u79bb\u73af\u5883\uff0c\u5982venv\u548crbenv\u7b49\uff0c\u65e8\u5728\u5b9e\u73b0\u5728\u5e93\u7ba1\u7406\u7b49\u65b9\u9762\u5b9e\u73b0\u677e\u8026\u5408\u7684\u5e94\u7528\u3002<\/p>\n<p>VirtualBox\u548cVMware\u662f\u4e00\u79cd\u6280\u672f\uff0c\u5b83\u4eec\u4e0d\u4ec5\u80fd\u591f\u865a\u62df\u5316\u5e94\u7528\u7a0b\u5e8f\uff0c\u8fd8\u53ef\u4ee5\u4ece\u64cd\u4f5c\u7cfb\u7edf\u5f00\u59cb\u5b8c\u5168\u8fdb\u884c\u865a\u62df\u5316\u3002\u8fd9\u4e9b\u88ab\u79f0\u4e3a\u865a\u62df\u673a\u3002\u6709\u4e00\u4e2a\u540d\u4e3aVagrant\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06\u865a\u62df\u673a\u5f15\u5165VirtualBox\u548cVMware\uff0c\u5176\u4e2d\u7684\u865a\u62df\u673a\u6620\u50cf\u53ef\u4f9b\u4efb\u4f55\u4eba\u4f7f\u7528\uff0c\u5c31\u50cf\u73b0\u5728\u7684Docker Hub\u4e00\u6837\u3002<\/p>\n<p>\u5982\u679c\u4f7f\u7528\u865a\u62df\u673a\u6280\u672f\uff08VM\uff09\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e2d\u95f4\u4ef6\u5982Nginx\u548cMySQL\u7684\u865a\u62df\u5316\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5c06Nginx\u7b49\u9002\u5f53\u5730\u8bbe\u7f6e\u5728\u865a\u62df\u673a\u4e2d\uff0c\u5e76\u901a\u8fc7\u91cd\u590d\u4f7f\u7528\u8be5\u865a\u62df\u673a\u6620\u50cf\u6765\u89e3\u51b3\u4e0a\u8ff0\u7e41\u7410\u7684\u201c\u5b89\u88c5\u8bbe\u7f6e\u201d\u95ee\u9898\u3002<\/p>\n<p>\u5728\u8fd9\u91cc\u8d2a\u5fc3\u7684\u95ee\u9898\u662f\uff0c\u5f53\u91cd\u590d\u4f7f\u7528\u865a\u62df\u673a\u65f6\uff0c\u865a\u62df\u673a\u955c\u50cf\u7684\u5927\u5c0f\u975e\u5e38\u5927\u3002\u5b83\u53ef\u80fd\u6709\u51e0\u4e2aGB\u5230\u51e0\u5341GB\u3002\u6bcf\u6b21\u90fd\u8981\u4e0b\u8f7d\u548c\u542f\u52a8\u5b83\uff0c\u8fd9\u4f1a\u5e26\u6765\u592a\u591a\u7684\u989d\u5916\u8d1f\u62c5\u3002<\/p>\n<p>\u5982\u679c\u80fd\u50cf\u4f7f\u7528 python main.py \u547d\u4ee4\u8fd0\u884c\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u90a3\u6837\u7b80\u4fbf\u5730\u542f\u52a8\u548c\u6267\u884c\u865a\u62df\u673a\uff0c\u90a3\u5c31\u592a\u597d\u4e86\u3002<\/p>\n<p>\u8fd9\u91cc\u53ef\u4ee5\u5b9e\u73b0\u4f60\u7684\u613f\u671b\u7684\u662f\u96c6\u88c5\u7bb1\u3002<\/p>\n<h1>\u96c6\u88c5\u7bb1<\/h1>\n<p>\u5982\u679c\u8981\u7528\u7b80\u5355\u7684\u6bd4\u55bb\u6765\u89e3\u91ca\u5bb9\u5668\uff0c\u53ef\u4ee5\u8bf4\u5b83\u5c31\u50cf\u662f\u4e00\u4e2a\u5c0f\u578b\u7684\u865a\u62df\u673a\u3002\u5b83\u7ee7\u627f\u4e86\u865a\u62df\u673a\u7684\u201c\u9694\u79bb\u73af\u5883\u201d\u7684\u7279\u6027\uff0c\u800c\u4e14\u4f53\u79ef\u5c0f\uff0c\u5927\u7ea6\u53ea\u6709\u51e0\u767e\u5146\u5230\u51e0\u4e2a\u5343\u5146\u5b57\u8282\u7684\u5927\u5c0f\u3002<\/p>\n<p>\u5c0f\u3055\u306a VM \u3068\u3044\u3046\u306e\u306f\u6bd4\u55a9\u306b\u904e\u304e\u306a\u3044\u3053\u3068\u3092\u5f37\u8abf\u3057\u3066\u304a\u304f\u3002\u53b3\u5bc6\u306b\u306f\u3001 VM \u306b\u898b\u3048\u308b\u3088\u3046\u306b OS \u306a\u3069\u3092\u64ec\u4f3c\u7684\u306b\u6a21\u5023\u3057\u3066\u3044\u308b\u30a4\u30e1\u30fc\u30b8\u3002 VM \u306b\u63a5\u7d9a\u3059\u308b\u3068\u304d\u306b\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u304f\u3051\u308c\u3069\u3082\u3001\u30b3\u30f3\u30c6\u30ca\u3067\u3069\u3046\u3088\u3046\u306e\u3053\u3068\u3092\u3059\u308b\u5834\u5408\u306b\u306f \u7591\u4f3c\u30bf\u30fc\u30df\u30ca\u30eb \u3092\u958b\u304f\u3002\u308f\u3056\u308f\u3056 &#8220;\u7591\u4f3c&#8221; \u3068\u3044\u3046\u8a00\u8449\u3092\u4ed8\u3051\u305f\u304f\u306a\u308b\u304f\u3089\u3044\u306b\u306f\u3001\u3084\u306f\u308a\u6a21\u5023\u306b\u904e\u304e\u306a\u3044\u3002<\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u6280\u8853\u3068\u3057\u3066\u6709\u540d\u306a\u3082\u306e\u306f Docker \u3067\u3042\u308d\u3046\u3002\u3053\u3053\u3067\u30b3\u30f3\u30c6\u30ca\u6280\u8853\u3068\u547c\u3093\u3067\u3044\u308b\u306e\u306f\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u308b\u306e\u306f\u3082\u3061\u308d\u3093\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u52d5\u304b\u3059\u74b0\u5883\u3082\u540c\u6642\u306b\u542b\u3093\u3067\u3044\u308b\u3002 Docker \u306e\u4ed6\u306e\u30b3\u30f3\u30c6\u30ca\u6280\u8853\u3068\u8a00\u3048\u3070 rkt \u3084 CRI-O, containerd \u306a\u3069\u3002\u3053\u3053\u3067\u306f Docker \u306e\u8a71\u3092\u3059\u308b\u3002<\/p>\n<p>\u5728\u4f7f\u7528Docker\u521b\u5efa\u5bb9\u5668\u65f6\uff0c\u9700\u8981\u7f16\u5199\u7c7b\u4f3c\u4e0b\u9762\u7684Dockerfile\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\"># \u516c\u5f0f\u306ePython 3.9\u30a4\u30e1\u30fc\u30b8\u3092\u30d9\u30fc\u30b9\u30a4\u30e1\u30fc\u30b8\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b<\/span>\r\n<span class=\"k\">FROM<\/span><span class=\"s\"> python:3.9<\/span>\r\n\r\n<span class=\"c\"># \u30b3\u30f3\u30c6\u30ca\u5185\u306e\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u8a2d\u5b9a\u3059\u308b<\/span>\r\n<span class=\"k\">WORKDIR<\/span><span class=\"s\"> \/app<\/span>\r\n\r\n<span class=\"c\"># requirements.txt\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30b3\u30d4\u30fc\u3059\u308b<\/span>\r\n<span class=\"k\">COPY<\/span><span class=\"s\"> requirements.txt .<\/span>\r\n\r\n<span class=\"c\"># requirements.txt\u304b\u3089\u4f9d\u5b58\u95a2\u4fc2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/span>\r\n<span class=\"k\">RUN <\/span>pip <span class=\"nb\">install<\/span> <span class=\"nt\">--no-cache-dir<\/span> <span class=\"nt\">-r<\/span> requirements.txt\r\n\r\n<span class=\"c\"># main.py\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30b3\u30d4\u30fc\u3059\u308b<\/span>\r\n<span class=\"k\">COPY<\/span><span class=\"s\"> main.py .<\/span>\r\n\r\n<span class=\"c\"># \u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3092main.py\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b<\/span>\r\n<span class=\"k\">CMD<\/span><span class=\"s\"> [\"python\", \"main.py\"]<\/span>\r\n<\/code><\/pre>\n<p>Dockerfile \u76f8\u5f53\u4e8e\u865a\u62df\u673a\u7684\u8bbe\u8ba1\u8bf4\u660e\u4e66\u6216\u865a\u62df\u673a\u6784\u5efa\u64cd\u4f5c\u6b65\u9aa4\u7684\u624b\u518c\u3002\u800c\u4e14\u4ee4\u4eba\u9ad8\u5174\u7684\u662f\uff0c\u8fd9\u91cc\u5b9a\u4e49\u7684\u5185\u5bb9\u4f1a\u81ea\u52a8\u6267\u884c\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u201c\u975e\u5e38\u75db\u82e6\u201d\u7684\u95ee\u9898\u5c31\u80fd\u591f\u89e3\u51b3\u4e86\u3002<\/p>\n<p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u63d0\u5230\u4e00\u4e0b\u4f7f\u7528\u96c6\u88c5\u7bb1\u8fdb\u884c\u8fd0\u8425\u3002<\/p>\n<p>\u5047\u8bbe\u6211\u4eec\u8003\u8651\u5bf9\u4e8e\u5df2\u7ecf\u521b\u5efa\u7684\u5bb9\u5668\u955c\u50cf\u8fdb\u884c\u4e00\u4e9b\u4fee\u6539\u7684\u60c5\u51b5\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8fdb\u5165\u5bb9\u5668\u5e76\u8fdb\u884c\u914d\u7f6e\u4fee\u6539\u6765\u8fbe\u5230\u76ee\u7684\u3002<\/p>\n<p>\u7136\u800c\uff0c\u5982\u679c\u7ee7\u7eed\u8fd9\u6837\u505a\uff0c\u4f1a\u518d\u6b21\u51fa\u73b0\u56e0\u624b\u52a8\u8fdb\u884c\u8bbe\u7f6e\u800c\u5e26\u6765\u7684\u201c\u975e\u5e38\u7e41\u7410\u201d\u7684\u95ee\u9898\u3002<\/p>\n<p>\u3067\u306f\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u304b\u3002\u3053\u306e\u5834\u5408\u3001 \u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u3092\u58ca\u3057\u3066\u3001 Dockerfile \u3092\u66f8\u304d\u63db\u3048\u3066\u3001\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u308a\u76f4\u3059 \u3068\u3044\u3046\u3053\u3068\u3002\u3053\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3001\u30a4\u30e1\u30fc\u30b8\u306e\u4e2d\u8eab\u306f Dockerfile \u3068\u540c\u671f\u3055\u308c\u308b\u3002 &#8220;Dockerfile \u306b\u304b\u304b\u308c\u3066\u3044\u306a\u3044\u7279\u5225\u306a\u624b\u9806&#8221; \u3068\u3044\u3046\u3082\u306e\u304c\u5b58\u5728\u3057\u306a\u304f\u306a\u308b\u3002\u305d\u308c\u6545\u3001\u4e0a\u306b\u8ff0\u3079\u305f\u300c\u3068\u306b\u304b\u304f\u3060\u308b\u3044\u300d\u554f\u984c\u3082\u89e3\u6d88\u3055\u308c\u308b\u3002<\/p>\n<p>\u3053\u308c\u306f\u300c\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u3092\u4e00\u5ea6\u69cb\u7bc9\u3057\u305f\u3089\u4e0d\u5909\u3067\u3042\u308b(\u305d\u308c\u6545\u3001\u4fee\u6b63\u304c\u5fc5\u8981\u306a\u3089\u3070\u4e00\u5ea6\u58ca\u3057\u3066\u4f5c\u308a\u76f4\u3059)\u300d\u3068\u3044\u3046\u98a8\u306b\u8a00\u3044\u63db\u3048\u3089\u308c\u308b\u3002\u3053\u306e\u3088\u3046\u306a\u3053\u3068\u3092\u30b3\u30f3\u30c6\u30ca\u306e \u30a4\u30df\u30e5\u30fc\u30bf\u30d3\u30ea\u30c6\u30a3 (immutability) \u3068\u8868\u73fe\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u30a4\u30df\u30e5\u30fc\u30bf\u30d3\u30ea\u30c6\u30a3\u3068\u306f\u65e5\u672c\u8a9e\u3067\u300c\u4e0d\u5909\u6027\u300d\u3068\u8868\u73fe\u3055\u308c\u308b\u3082\u306e\u3002\u30b3\u30f3\u30c6\u30ca\u306e\u904b\u7528\u306f\u30a4\u30df\u30e5\u30fc\u30bf\u30d3\u30ea\u30c6\u30a3\u3092\u610f\u8b58\u3059\u308b\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u904b\u7528\u304c\u60f3\u5b9a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304b\u3089\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u30d9\u30fc\u30b9\u30a4\u30e1\u30fc\u30b8\u306b\u3088\u3063\u3066\u306f\u3001 cd \u3084 cat \u306e\u3088\u3046\u306a\u3001\u30b5\u30fc\u30d0\u30fc\u306e\u4f5c\u696d\u306b\u5f53\u7136\u5fc5\u8981\u306a\u30b3\u30de\u30f3\u30c9\u3059\u3089\u5165\u3063\u3066\u3044\u306a\u3044\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u3002\u305d\u306e\u3088\u3046\u306a\u300c\u4eba\u9593\u304c\u4f5c\u696d\u3059\u308b\u300d\u3068\u3044\u3046\u3053\u3068\u3092\u5fb9\u5e95\u7684\u306b\u6392\u9664\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30f3\u30c6\u30ca\u306b\u8a70\u3081\u8fbc\u3080\u306e\u306b\u5fc5\u8981\u306a\u30b3\u30de\u30f3\u30c9\u306e\u30d0\u30a4\u30ca\u30ea\u306a\u3069\u3092\u7121\u304f\u3057\u3066\u3001\u6975\u9650\u307e\u3067\u30a4\u30e1\u30fc\u30b8\u306e\u30b5\u30a4\u30ba\u3092\u5c0f\u3055\u304f\u3057\u3088\u3046\u3068\u3059\u308b\u3002<\/p>\n<h1>\u5bb9\u5668\u7f16\u6392\u5668<\/h1>\n<p>\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u5173\u6ce8\u4e00\u4e0b\u5982\u4f55\u79fb\u52a8\u96c6\u88c5\u7bb1\u3002<\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u306b\u306f\u4e00\u3064\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u8a70\u3081\u8fbc\u307e\u308c\u3066\u3044\u308b\u3068\u3057\u3088\u3046(\u9ad8\u51dd\u96c6\u3067\u3042\u308b)\u3002\u4e00\u3064\u306e\u30d7\u30ed\u30c0\u30af\u30c8\u3092\u52d5\u304b\u3059\u306b\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u305f\u3063\u305f\u4e00\u3064\u3042\u308c\u3070\u5341\u5206\u3068\u3044\u3046\u3053\u3068\u306f\u307b\u3068\u3093\u3069\u7121\u3044\u3060\u308d\u3046\u3002\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3068\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u304c\u5225\u308c\u3066\u3044\u308b\u3053\u3068\u306f\u5e38\u3067\u3042\u308b\u3057\u3001 DB \u3084 LoadBalancer \u3068\u3044\u3063\u305f\u30a2\u30d7\u30ea\u3082\u5fc5\u8981\u3067\u3042\u308b\u3002\u3057\u304b\u3082\u3001\u3053\u308c\u3089\u306f\u4e92\u3044\u306b \u5354\u8abf\u3057\u3066\u52d5\u4f5c\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<\/p>\n<p>\u5354\u8abf\u3057\u3066\u52d5\u4f5c\u3059\u308b\u3068\u306f\u3069\u3046\u3044\u3046\u3053\u3068\u304b\u3002\u305d\u308c\u306f\u4f8b\u3048\u3070\u3001\u300cLoadBalancer \u306e\u30b3\u30f3\u30c6\u30ca\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u305f\u3089\u3001\u3053\u306e\u30a2\u30d7\u30ea\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u6d41\u3055\u306d\u3070\u306a\u3089\u306a\u3044\u300d\u300c\u3053\u306e\u30a2\u30d7\u30ea\u306e\u30b3\u30f3\u30c6\u30ca\u306f DB \u306e\u30b3\u30f3\u30c6\u30ca\u3068\u901a\u4fe1\u3092\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3051\u308c\u3069\u3001\u3053\u3063\u3061\u306e\u30a2\u30d7\u30ea\u306e\u30b3\u30f3\u30c6\u30ca\u306f DB \u306b\u63a5\u7d9a\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u300d\u306a\u3069\u3068\u3044\u3046\u3053\u3068\u3002<\/p>\n<p>\u6362\u53e5\u8bdd\u8bf4\uff0c\u9700\u8981\u7ba1\u7406\u5bb9\u5668\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/p>\n<p>\u5c06\u8d1f\u8d23\u6b64\u7ba1\u7406\u7684\u5b9e\u4f53\u79f0\u4e3a\u5bb9\u5668\u7f16\u6392\u5668\u3002<\/p>\n<p>\u4f5c\u4e3a\u4e00\u4e2a\u5bb9\u5668\u7f16\u6392\u5de5\u5177\uff0c\u7b2c\u4e00\u4e2a\u8ba9\u4eba\u60f3\u5230\u7684\u662f Docker Compose\u3002\u53ea\u9700\u7f16\u5199\u4e00\u4e2a\u5305\u542b\u5bb9\u5668\u4e4b\u95f4\u76f8\u4e92\u4ea4\u4e92\u7684\u63cf\u8ff0\u6587\u4ef6\uff0c\u7136\u540e\u8fd0\u884c docker compose up \u547d\u4ee4\uff0c\u5373\u53ef\u8ba9\u5bb9\u5668\u6309\u7167\u63cf\u8ff0\u6587\u4ef6\u4e2d\u7684\u8981\u6c42\u8fd0\u884c\u3002\u4ee5\u4e0b\u662f\u6211\u81ea\u5df1\u7f16\u5199\u7684\u7528\u4e8e\u8ba9\u6211\u7684 Web \u5e94\u7528\u8bbf\u95ee MySQL \u7684 docker-compose.yaml \u6587\u4ef6\u7684\u793a\u4f8b\uff1a<\/p>\n<pre class=\"post-pre\"><code><span class=\"na\">version<\/span><span class=\"pi\">:<\/span> <span class=\"s1\">'<\/span><span class=\"s\">3'<\/span>\r\n<span class=\"na\">services<\/span><span class=\"pi\">:<\/span>\r\n  <span class=\"na\">webserver<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"na\">image<\/span><span class=\"pi\">:<\/span> <span class=\"s\">myimage<\/span>\r\n    <span class=\"na\">ports<\/span><span class=\"pi\">:<\/span>\r\n      <span class=\"pi\">-<\/span> <span class=\"s\">8080:8080<\/span>\r\n    <span class=\"na\">depends_on<\/span><span class=\"pi\">:<\/span>\r\n      <span class=\"pi\">-<\/span> <span class=\"s\">mysql<\/span>\r\n\r\n  <span class=\"na\">mysql<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"na\">image<\/span><span class=\"pi\">:<\/span> <span class=\"s\">mysql<\/span>\r\n    <span class=\"na\">environment<\/span><span class=\"pi\">:<\/span>\r\n      <span class=\"pi\">-<\/span> <span class=\"s\">MYSQL_ROOT_PASSWORD=secret<\/span>\r\n<\/code><\/pre>\n<p>\u5bf9\u4e8e\u5f00\u53d1\u76ee\u7684\u6765\u8bf4\u975e\u5e38\u65b9\u4fbf\u3002<\/p>\n<p>\u90a3\u4e48\uff0c\u5982\u679c\u662f\u5728\u5b9e\u9645\u573a\u666f\u4e2d\u4f7f\u7528\u5462\uff1f\u8fd9\u5c31\u5b58\u5728\u95ee\u9898\u4e86\u3002<\/p>\n<p>\u56e0\u4e3aDocker Compose\u53ea\u652f\u6301\u5728\u4e00\u53f0\u670d\u52a1\u5668\u4e2d\u8fd0\u884c\u591a\u4e2a\u5bb9\u5668\u7684\u7528\u4f8b\u3002\u5bf9\u4e8e\u751f\u4ea7\u73af\u5883\uff0c\u6b63\u5982\u4e4b\u524d\u63d0\u5230\u7684\uff0c\u6211\u4eec\u9700\u8981\u5728\u591a\u53f0\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u591a\u4e2a\u76f8\u540c\u7684\u5e94\u7528\u7a0b\u5e8f\u4ee5\u786e\u4fdd\u5bb9\u9519\u6027\u548c\u53ef\u6269\u5c55\u6027\u3002\u6362\u53e5\u8bdd\u8bf4\uff0cDocker Compose\u65e0\u6cd5\u6ee1\u8db3\u5728\u8fd9\u65b9\u9762\u7684\u751f\u4ea7\u73af\u5883\u9700\u6c42\u3002<\/p>\n<p>\u90a3\u4e48\u6bcf\u4e2a\u670d\u52a1\u5668\u90fd\u8981\u8fdb\u53bb\uff0c\u7136\u540e\u5728\u5404\u81ea\u7684\u670d\u52a1\u5668\u4e0a\u6267\u884c docker compose\uff0c\u5bf9\u5417\uff1f\u8fd9\u4e5f\u662f\u4e00\u79cd\u65b9\u6cd5\uff0c\u4f46\u662f\u8fd9\u6837\u4e00\u6765\uff0c\u5c31\u65e0\u6cd5\u4eab\u53d7\u5230\u4e0a\u9762\u63d0\u5230\u7684&#8221;\u53ea\u9700\u7f16\u5199docker-compose.yaml\u5e76\u8fd0\u884cdocker-compose up\u5373\u53ef\u4e00\u6b21\u6027\u8fd0\u884c\u6240\u6709\u670d\u52a1&#8221;\u7684\u4f18\u70b9\u4e86\u3002<\/p>\n<p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u9700\u8981\u7684\u53ea\u662f\u4e00\u4e2a\u80fd\u591f\u5b9a\u4e49\u5bb9\u5668\u8fd0\u884c\u65b9\u5f0f\uff0c\u80fd\u591f\u5728\u591a\u53f0\u670d\u52a1\u5668\u4e0a\u7075\u6d3b\u8fd0\u884c\u7684\u5de5\u5177\uff0c\u5c31\u50cf docker-compose.yaml \u4e00\u6837\u3002<\/p>\n<p>\u6709\u8fd9\u6837\u7684\u4e1c\u897f\u5417\uff1f\u6709\u7684\u3002\u90a3\u5c31\u662f Kubernetes \u548c Amazon ECS \u7b49\u3002<\/p>\n<p>Kubernetes\u548cECS\u90fd\u63d0\u4f9b\u4e86\u5728\u591a\u4e2a\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u5bb9\u5668\u7684\u673a\u5236\u3002\u4ee5\u524d\u6709Docker Swarm\u548cMethos\u7b49\uff0c\u4f46\u73b0\u5728\u8fd9\u4e9b\u6bd4\u8f83\u5f3a\u5927\u3002AWS\u7684EKS\uff08\u5f39\u6027Kubernetes\u670d\u52a1\uff09\u3001Azure\u7684AKS\uff08Azure Kubernetes\u670d\u52a1\uff09\u548cGCP\u7684GKE\uff08Google Kubernetes\u5f15\u64ce\uff09\u90fd\u662f\u5c06Kubernetes\u5c01\u88c5\u63d0\u4f9b\u7684\u670d\u52a1\u3002<\/p>\n<p>Kubernetes \u662f\u8c37\u6b4c\u6e90\u81ea\u7684\u5f00\u6e90\u8f6f\u4ef6\uff0c\u65e9\u671f\u88ab\u79f0\u4e3aBorg\u3002\u6709\u5173\u5176\u80cc\u666f\u7ec6\u8282\u5728\u4e4b\u524d\u4ecb\u7ecd\u8fc7\u7684\u300a\u6ca1\u4eba\u8bfb\u8fc7\u7684SRE\u4e66\u300b\u4e2d\u6709\u8be6\u7ec6\u63cf\u8ff0\u3002<\/p>\n<p>\u7b80\u5355\u89e3\u91caKubernetes\u7684\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<p>\u9996\u5148\u6211\u4eec\u8981\u5199\u4e00\u4e2a\u88ab\u79f0\u4e3a\u6e05\u5355\u6587\u4ef6\u7684\u4e1c\u897f\u3002\u5b83\u66ff\u4ee3\u4e86docker-compose.yaml\uff0c\u63cf\u8ff0\u4e86\u5bb9\u5668\u5e94\u8be5\u5982\u4f55\u8fd0\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"na\">apiVersion<\/span><span class=\"pi\">:<\/span> <span class=\"s\">apps\/v1<\/span>\r\n<span class=\"na\">kind<\/span><span class=\"pi\">:<\/span> <span class=\"s\">Deployment<\/span>\r\n<span class=\"na\">metadata<\/span><span class=\"pi\">:<\/span>\r\n  <span class=\"na\">name<\/span><span class=\"pi\">:<\/span> <span class=\"s\">mywebapp-deployment<\/span>\r\n<span class=\"na\">spec<\/span><span class=\"pi\">:<\/span>\r\n  <span class=\"na\">replicas<\/span><span class=\"pi\">:<\/span> <span class=\"m\">2<\/span>\r\n  <span class=\"na\">selector<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"na\">matchLabels<\/span><span class=\"pi\">:<\/span>\r\n      <span class=\"na\">app<\/span><span class=\"pi\">:<\/span> <span class=\"s\">mywebapp<\/span>\r\n  <span class=\"na\">template<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"na\">metadata<\/span><span class=\"pi\">:<\/span>\r\n      <span class=\"na\">labels<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"na\">app<\/span><span class=\"pi\">:<\/span> <span class=\"s\">mywebapp<\/span>\r\n    <span class=\"na\">spec<\/span><span class=\"pi\">:<\/span>\r\n      <span class=\"na\">containers<\/span><span class=\"pi\">:<\/span>\r\n        <span class=\"pi\">-<\/span> <span class=\"na\">name<\/span><span class=\"pi\">:<\/span> <span class=\"s\">mywebapp<\/span>\r\n          <span class=\"na\">image<\/span><span class=\"pi\">:<\/span> <span class=\"s\">mywebapp:latest<\/span>\r\n          <span class=\"na\">ports<\/span><span class=\"pi\">:<\/span>\r\n            <span class=\"pi\">-<\/span> <span class=\"na\">containerPort<\/span><span class=\"pi\">:<\/span> <span class=\"m\">80<\/span>\r\n\r\n<span class=\"nn\">---<\/span>\r\n\r\n<span class=\"na\">apiVersion<\/span><span class=\"pi\">:<\/span> <span class=\"s\">v1<\/span>\r\n<span class=\"na\">kind<\/span><span class=\"pi\">:<\/span> <span class=\"s\">Service<\/span>\r\n<span class=\"na\">metadata<\/span><span class=\"pi\">:<\/span>\r\n  <span class=\"na\">name<\/span><span class=\"pi\">:<\/span> <span class=\"s\">mywebapp-service<\/span>\r\n<span class=\"na\">spec<\/span><span class=\"pi\">:<\/span>\r\n  <span class=\"na\">type<\/span><span class=\"pi\">:<\/span> <span class=\"s\">LoadBalancer<\/span>\r\n  <span class=\"na\">selector<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"na\">app<\/span><span class=\"pi\">:<\/span> <span class=\"s\">mywebapp<\/span>\r\n  <span class=\"na\">ports<\/span><span class=\"pi\">:<\/span>\r\n    <span class=\"pi\">-<\/span> <span class=\"na\">protocol<\/span><span class=\"pi\">:<\/span> <span class=\"s\">TCP<\/span>\r\n      <span class=\"na\">port<\/span><span class=\"pi\">:<\/span> <span class=\"m\">80<\/span>\r\n      <span class=\"na\">targetPort<\/span><span class=\"pi\">:<\/span> <span class=\"m\">80<\/span>\r\n<\/code><\/pre>\n<p>\u53ea\u9700\u521b\u5efa\u6b64\u6587\u4ef6\u5e76\u8fd0\u884c &#8220;kubectl apply&#8221; \u547d\u4ee4\uff0c\u5c31\u80fd\u60ca\u4eba\u5730\u6784\u5efa\u5148\u524d\u6587\u7ae0\u4e2d\u4ecb\u7ecd\u7684\u4ee5\u4e0b\u914d\u7f6e\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d243337434c4406c2dc7a\/57-0.png\" alt=\"image.png\" \/><\/div>\n<p>\u987a\u4fbf\u63d0\u4e00\u4e0b\uff0cECS\u548cEKS\uff08AWS\u63d0\u4f9b\u7684Kubernetes\u670d\u52a1\uff09\u4e4b\u95f4\u7684\u533a\u522b\u3002<\/p>\n<p>\u901a\u8fc7\u4e66\u5199\u7c7b\u4f3c\u4e0a\u8ff0\u5b9a\u4e49\u6587\u4ef6\uff0cECS\u4e5f\u80fd\u591f\u5b9e\u73b0\u6309\u7167\u6240\u5199\u7684\u8981\u6c42\u6784\u5efa\u57fa\u7840\u67b6\u6784\uff0c\u4e0eKubernetes\u5728\u8fd9\u65b9\u9762\u76f8\u540c\u3002\u7136\u800c\uff0cECS\u91c7\u7528\u4e86\u4e0eKubernetes\u4e0d\u540c\u7684\u6280\u672f\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u5728\u5229\u7528\u65b9\u9762\uff0c\u6700\u5927\u7684\u533a\u522b\u5728\u4e8e\u8c01\u6765\u8fdb\u884c\u670d\u52a1\u5668\u7ba1\u7406\u3002<\/p>\n<p>\u4f7f\u7528ECS\u65f6\uff0c\u7528\u6237\u65e0\u9700\u5173\u5fc3\u670d\u52a1\u5668\u7ba1\u7406\u95ee\u9898\uff0c\u53ea\u9700\u610f\u8bc6\u5230\u4ed6\u4eec\u5e0c\u671b\u4ee5\u600e\u6837\u7684\u914d\u7f6e\u6765\u8fd0\u884c\u5bb9\u5668\u5373\u53ef\u3002<\/p>\n<p>\u4e00\u65b9\uff0cEKS \u5219\u4e0d\u540c\u3002\u5fc5\u987b\u8981\u7ba1\u7406 Kubernetes \u96c6\u7fa4\u672c\u8eab\u3002\u4f8b\u5982\uff0cKubernetes \u5927\u7ea6\u6bcf\u56db\u4e2a\u6708\u9700\u8981\u66f4\u65b0\u4e00\u6b21\u96c6\u7fa4\u3002\u8fd9\u9879\u5de5\u4f5c\u76f8\u5f53\u7e41\u7410\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528EKS\u5230\u8fd9\u4e2a\u7a0b\u5ea6\uff1f\u539f\u56e0\u5728\u4e8eKubernetes\u7684\u53ef\u5b9a\u5236\u6027\u3002\u901a\u8fc7\u4f7f\u7528\u81ea\u5b9a\u4e49\u8d44\u6e90\u548c\u64cd\u4f5c\u8005\u6a21\u5f0f\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u521b\u5efa\u81ea\u5df1\u7684kubectl\u547d\u4ee4\uff0c\u5e76\u4e14\u53ef\u4ee5\u76f8\u5f53\u7a0b\u5ea6\u5730\u5b9a\u5236\u884c\u4e3a\u3002\u5982\u679c\u5728\u4e00\u4e2a\u89c4\u6a21\u8f83\u5927\u7684\u516c\u53f8\u4e2d\uff0c\u6709\u591a\u4e2a\u4ea7\u54c1\u90fd\u4f7f\u7528Kubernetes\u8fdb\u884c\u8fd0\u884c\u7684\u51b3\u7b56\uff0c\u90a3\u4e48\u4eba\u4eec\u4e5f\u4f1a\u5e0c\u671b\u8fdb\u884c\u8fd9\u6837\u7684\u5b9a\u5236\u3002<\/p>\n<p>\u9806\u4fbf\u63d0\u4e00\u4e0b\uff0c\u5728\u672c\u5730\u80fd\u8fd0\u884c Kubernetes \u5417\uff1f\u53ef\u4ee5\u3002\u4f8b\u5982 Docker Desktop \u4e0a\u6709 Kubernetes \u6a21\u5f0f\u3002\u5b83\u53ef\u4ee5\u63a5\u53d7 Kubernetes \u7684\u914d\u7f6e\u6587\u4ef6\u5e76\u5728\u672c\u5730\u8fdb\u884c\u590d\u73b0\u3002<\/p>\n<p>\u5728\u4f01\u4e1a\u5185\u90e8\u7ba1\u7406Kubernetes\u9700\u8981\u76f8\u5f53\u5927\u7684\u4f53\u529b\u3002\u8bf7\u8003\u8651\u4e00\u4e0b\u3002\u5982\u679c\u6709Kubernetes\uff0c\u5e94\u7528\u7a0b\u5e8f\u4f1a\u53d8\u5f97\u8f7b\u677e\uff0c\u4f46\u6784\u5efaKubernetes\u672c\u8eab\u9700\u8981\u76f4\u63a5\u5728\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u64cd\u4f5c\u3002\u867d\u7136\u6709\u5f88\u591a\u5de5\u5177\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u8fd9\u65b9\u9762\u7684\u4efb\u52a1\uff0c\u4f46\u662f\u9884\u6599\u5230\u4f1a\u9047\u5230\u5f88\u591a\u56f0\u96be\u3002\u5b9e\u9645\u4e0a\uff0c\u50cfLINE\u548cYahoo\u8fd9\u6837\u7684\u516c\u53f8\u90fd\u6709\u4e13\u95e8\u8d1f\u8d23\u7ba1\u7406Kubernetes\u7684\u56e2\u961f\u3002\u8003\u8651\u5230\u8fd9\u4e2a\u7ba1\u7406\u5de5\u4f5c\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u9009\u62e9\u5c06\u5176\u4ea4\u7ed9\u4e91\u670d\u52a1\u63d0\u4f9b\u5546\uff0c\u4f5c\u4e3a\u5bf9\u65b9\u63d0\u4f9b\u670d\u52a1\u7684\u4ee3\u4ef7\uff0c\u4ed8\u94b1\u7ed9\u4ed6\u4eec\u3002<\/p>\n<h1>\u57fa\u65bc\u5ba3\u8a00\u7684\u67b6\u8a2d\u548cIaC<\/h1>\n<p>\u8fd9\u4e0d\u662f\u5173\u4e8e\u57fa\u7840\u8bbe\u65bd\u7684\u8ba8\u8bba\uff0c\u6709\u4e00\u4e2a\u53eb\u505a\u58f0\u660e\u5f0f\u914d\u7f6e\u7684\u8bcd\u3002\u8fd8\u6709\u4e00\u4e2a\u7c7b\u4f3c\u52a8\u673a\u7684\u8bcd\u53eb\u505a\u58f0\u660e\u5f0f\u7f16\u7a0b\u3002<\/p>\n<p>\u3053\u308c\u3089\u306f\u8a2d\u5b9a\u3084\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a18\u6cd5\u306e\u4e00\u7a2e\u3067\u3001\u300c\u3069\u306e\u3088\u3046\u306b \u7406\u60f3\u7684\u306a\u72b6\u614b\u306b\u3059\u308b\u304b\u300d\u3068\u3044\u3046\u624b\u7d9a\u304d\u306b\u6ce8\u76ee\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u300c\u6700\u7d42\u7684\u306b\u5b9f\u73fe\u3057\u305f\u3044\u72b6\u614b\u306f \u306a\u306b\u304b\u300d\u306b\u6ce8\u76ee\u3057\u305f\u66f8\u304d\u65b9\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u6700\u9069\u5316\u7406\u8ad6\u306e\u5b9a\u5f0f\u5316\u306a\u3069\u306f\u3001\u3044\u308f\u3086\u308b\u5ba3\u8a00\u7684\u8a2d\u5b9a\u306e\u30cb\u30e5\u30a2\u30f3\u30b9\u304c\u5f37\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>\\begin{align}\r\n\\min_{\\vec{x}} \\ &amp; f(\\vec{x}) \\\\\r\n\\text{s.t.} \\ &amp; g_1(\\vec{x}) \\leq 0, \\\\\r\n&amp; g_2(\\vec{x}) \\leq 0, \\\\\r\n&amp; \\vdots \\\\\r\n&amp; g_M(\\vec{x})\\leq 0 . \r\n\\end{align}\r\n<\/code><\/pre>\n<p>$\\text{s.t.}$ \u306e\u3068\u3053\u308d\u306b\u5236\u7d04\u6761\u4ef6\u304c\u8868\u73fe\u3055\u308c\u3066\u3044\u308b\u308f\u3051\u3060\u3051\u3069\u3082\u3001\u3053\u3053\u306b\u306f\u300c\u3069\u306e\u3088\u3046\u306b\u3053\u306e\u5236\u7d04\u6761\u4ef6\u3092\u6e80\u305f\u3059\u304b\u300d\u306b\u3064\u3044\u3066\u306f\u8a00\u53ca\u3057\u3066\u3044\u306a\u3044\u3002\u6700\u9069\u5316\u306e\u30bd\u30eb\u30d0\u30fc\u306a\u3069\u306f\u3001\u3053\u306e\u76ee\u7684\u95a2\u6570\u3068\u5236\u7d04\u6761\u4ef6\u3092\u4e0a\u306e\u3088\u3046\u306a\u96f0\u56f2\u6c17\u3067\u8a2d\u5b9a\u3059\u308b\u3060\u3051\u3067\u3088\u3044\u3001\u3068\u3044\u3063\u305f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u6e96\u5099\u3057\u3066\u304f\u308c\u3066\u305f\u308a\u3059\u308b\u3002<\/p>\n<p>\u53ef\u4ee5\u5c07\u9019\u500b\u9673\u8ff0\u7ffb\u8b6f\u70ba\uff1a\u5ba3\u8a00\u5f0f\u8a2d\u5b9a\u7684\u53cd\u7fa9\u8a5e\u662f\u547d\u4ee4\u5f0f\u8a2d\u5b9a\u3002\u547d\u4ee4\u5f0f\u8a2d\u5b9a\u7528\u65bc\u63cf\u8ff0\u300c\u5982\u4f55\u5be6\u73fe\u300d\u7684\u65b9\u5f0f\u3002\u5927\u90e8\u5206\u7684\u7de8\u7a0b\u8a9e\u8a00\u5c6c\u65bc\u9019\u4e00\u985e\u578b\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u63d0\u5230\u58f0\u660e\u6027\u8bbe\u7f6e\uff1f\u56e0\u4e3a\u4e0a\u9762\u7684\u6e05\u5355\u6587\u4ef6\u6b63\u662f\u6307\u7684\u90a3\u4e2a\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u30fc\u7ba1\u7406\u3092\u624b\u52d5\u3067\u3084\u308b\u5834\u5408\u3001 \u624b\u9806\u66f8 \u3068\u3044\u3063\u305f\u3082\u306e\u304c\u5fc5\u8981\u3002\u30b9\u30c6\u30c3\u30d7\u3054\u3068\u306b\u3084\u308b\u3053\u3068\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u3066\u3001\u305d\u308c\u3092\u9806\u756a\u3069\u304a\u308a\u306b\u3084\u3063\u3066\u3044\u3051\u3070\u9054\u6210\u3067\u304d\u308b\u3001\u3068\u3044\u3046\u300c\u3069\u306e\u3088\u3046\u306b\u9054\u6210\u3059\u308b\u304b\u300d\u306b\u30d5\u30a9\u30fc\u30ab\u30b9\u3057\u305f\u5b58\u5728\u3002<\/p>\n<p>\u3053\u306e\u547d\u4ee4\u7684\u8a2d\u5b9a\u3060\u3068\u3001\u7d50\u69cb\u7169\u96d1\u306b\u306a\u308b\u3002\u4f8b\u3048\u3070\u300c\u5197\u9577\u5316\u306e\u305f\u3081\u306b\u3001\u30a2\u30d7\u30ea\u304c4\u3064\u52d5\u3044\u3066\u3044\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u300d\u3068\u3044\u3046\u7406\u60f3\u7684\u306a\u72b6\u614b\u304c\u3042\u308b\u3068\u3059\u308b\u3002\u305d\u308c\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u3001 \u4eca\u30a2\u30d7\u30ea\u304c\u3044\u304f\u3064\u52d5\u3044\u3066\u3044\u308b\u304b \u3092\u77e5\u3063\u3066\u3001\u305d\u308c\u306b\u5fdc\u3058\u3066 \u30aa\u30da\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002\u4f8b\u3048\u3070\u4eca\u30a2\u30d7\u30ea\u304c\u4e00\u3064\u3082\u52d5\u3044\u3066\u3044\u306a\u3044\u3068\u3057\u3088\u3046\u3002\u305d\u306e\u5834\u5408\u306f 4 \u3064\u306e\u30a2\u30d7\u30ea\u3092\u8d77\u52d5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u3042\u308b\u3044\u306f\u3082\u3068\u3082\u3068 6 \u3064\u306e\u30a2\u30d7\u30ea\u304c\u52d5\u3044\u3066\u3044\u3066\u3001\u305d\u308c\u306e\u30b9\u30b1\u30fc\u30eb\u30c0\u30a6\u30f3\u3092\u8003\u3048\u3066\u3044\u308b\u3068\u3057\u3088\u3046\u3002\u305d\u306e\u5834\u5408\u306f 2 \u3064\u306e\u30a2\u30d7\u30ea\u3092\u505c\u6b62\u3055\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u3068\u3044\u3063\u305f\u5177\u5408\u3002<\/p>\n<p>\u3053\u3053\u3067\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u898b\u308b\u3002\u3053\u3053\u3067\u306f<\/p>\n<pre class=\"post-pre\"><code><span class=\"nn\">...<\/span>\r\n<span class=\"na\">spec<\/span><span class=\"pi\">:<\/span>\r\n  <span class=\"na\">replicas<\/span><span class=\"pi\">:<\/span> <span class=\"m\">2<\/span>\r\n<span class=\"nn\">...<\/span>\r\n<\/code><\/pre>\n<p>\u3068\u3044\u3046\u3075\u3046\u306b\u3001\u300c\u3068\u306b\u304b\u304f 2 \u3064\u52d5\u3044\u3066\u307b\u3057\u3044\u300d\u3068\u5ba3\u8a00\u3057\u3066\u3044\u308b\u3060\u3051\u3002 Kubernetes \u3084 ECS \u306f\u8ce2\u304f\u3066\u3001 \u3069\u3093\u306a\u3053\u3068\u304c\u8d77\u304d\u3066\u3082\u30a2\u30d7\u30ea\u304c 2 \u3064\u52d5\u3044\u3066\u3044\u308b\u72b6\u614b\u3092\u5b9f\u73fe\u3057\u3066\u304f\u308c\u308b\u3002 Kubernetes \u306f\u4eca\u30b3\u30f3\u30c6\u30ca\u304c\u3044\u304f\u3064\u52d5\u3044\u3066\u3044\u308b\u304b\u3092\u5e38\u306b\u76e3\u8996\u3057\u3066\u3044\u3066\u3001\u3082\u3057\u3082\u969c\u5bb3\u306a\u3069\u3067\u30a2\u30d7\u30ea\u304c 1 \u3064\u3057\u304b\u52d5\u3044\u3066\u3044\u306a\u3044\u72b6\u614b\u304c\u6570\u79d2\u3042\u3063\u305f\u3089\u3001 \u81ea\u52d5\u7684\u306b 2 \u3064\u76ee\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u3069\u3053\u304b\u306e\u30b5\u30fc\u30d0\u30fc\u3067\u52d5\u304b\u3057\u3066\u304f\u308c\u308b\u3002\u3053\u306e replicas \u306e\u5024\u3092\u4f8b\u3048\u3070 5 \u306b\u3057\u3066\u3001 kubectl apply \u3092\u3057\u305f\u3089\u3001\u81ea\u52d5\u7684\u306b 3 \u3064\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u3069\u3053\u304b\u306e\u30b5\u30fc\u30d0\u30fc\u3067\u8d77\u52d5\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n<p>\u3053\u308c\u306f\u8010\u969c\u5bb3\u6027\u304c\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u308b\u3002\u305f\u3068\u3048\u3070\u30b5\u30fc\u30d0\u30fc\u304c\u4e00\u3064\u843d\u3061\u305f\u5834\u5408\u3001\u305d\u306e\u4e0a\u3067\u52d5\u3044\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u304c\u3054\u3063\u305d\u308a\u6d88\u3048\u308b\u3002 Kubernetes \u306f\u52dd\u624b\u306b\u305d\u308c\u3092\u691c\u77e5\u3057\u3066\u3001\u3069\u3053\u304b\u7a7a\u3044\u3066\u308b\u30b5\u30fc\u30d0\u30fc\u3092\u81ea\u5206\u3067\u63a2\u3057\u3066\u3001\u3054\u3063\u305d\u308a\u6d88\u3048\u305f\u30b3\u30f3\u30c6\u30ca\u3092\u5168\u90e8\u8d77\u52d5\u3057\u306a\u304a\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n<p>\u3053\u306e\u4ed5\u7d44\u307f\u3092\u5fdc\u7528\u3057\u3066\u9762\u767d\u3044\u63d0\u4f9b\u306e\u4ed5\u65b9\u3092\u3057\u3066\u3044\u308b\u306e\u304c\u3001 Google \u306e GCP\u3002 Kubernetes \u306e\u30b5\u30fc\u30d0\u30fc\u3092\u9078\u629e\u3059\u308b\u3068\u304d\u306b \u30d7\u30ea\u30a8\u30f3\u30d7\u30c6\u30a3\u30d6\u30eb VM \u3068\u3044\u3046\u3082\u306e\u3092\u9078\u3076\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u3053\u308c\u306f\u300124\u6642\u9593\u304f\u3089\u3044\u3067\u81ea\u52d5\u7684\u306b\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u3066\u3057\u307e\u3046\u30b5\u30fc\u30d0\u30fc\u3002\u305d\u306e\u5206\u5b89\u3044\u3002\u305d\u3093\u306a\u306e\u56f0\u308b\uff01\u3068\u601d\u3046\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3001 Kubernetes \u306e\u3053\u306e\u6027\u8cea\u3092\u4f7f\u3048\u3070\u305d\u308c\u304c\u3055\u307b\u3069\u554f\u984c\u306b\u306a\u3089\u306a\u3044\u306e\u3082\u7406\u89e3\u3067\u304d\u308b\u3068\u601d\u3046\u3002<\/p>\n<p>\u3053\u3053\u304b\u3089 IaC (Infrastructure as Code) \u3068\u3044\u3046\u8a00\u8449\u3092\u5c0e\u5165\u3057\u305f\u3044\u3002\u3053\u308c\u306f\u5ba3\u8a00\u7684\u8a2d\u5b9a\u3068\u5bc6\u63a5\u306b\u95a2\u308f\u308a\u304c\u3042\u308b\u3002<\/p>\n<p>IaC \u3068\u306f\u3001\u30a4\u30f3\u30d5\u30e9\u306e\u72b6\u614b\u3092 \u30b3\u30fc\u30c9\u3068\u3057\u3066\u7ba1\u7406\u3059\u308b \u30a4\u30f3\u30d5\u30e9\u7ba1\u7406\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u306e\u4e00\u3064\u3002\u30b3\u30fc\u30c9\u3068\u3044\u3046\u304b\u3001\u4e0a\u306e\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u3088\u3046\u306a \u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb \u3068\u3057\u3066\u30a4\u30f3\u30d5\u30e9\u3092\u8a2d\u5b9a\u3059\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3002<\/p>\n<p>\u3053\u308c\u304c\u3067\u304d\u308b\u3068\u4f55\u304c\u3044\u3044\u304b\u3068\u3044\u3046\u3068\u3001 Git \u306e\u3088\u3046\u306a\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u306e\u4ed5\u7d44\u307f\u3092\u30a4\u30f3\u30d5\u30e9\u306b\u3082\u6301\u3061\u8fbc\u3081\u308b\u3053\u3068\u3002 GitHub \u3067 PR \u30d9\u30fc\u30b9\u3067\u30ec\u30d3\u30e5\u30fc\u3082\u3067\u304d\u305f\u308a\u3068\u3001\u30a2\u30d7\u30ea\u306e\u30b3\u30fc\u30c9\u306e\u958b\u767a\u30d5\u30ed\u30fc\u3068\u540c\u3058\u3084\u308a\u65b9\u304c\u3001\u30a4\u30f3\u30d5\u30e9\u306b\u304a\u3044\u3066\u3082\u3067\u304d\u308b\u3002<\/p>\n<p>\u53ef\u4ee5\u611f\u53d7\u5230IaC\uff08\u57fa\u7840\u8bbe\u65bd\u5373\u4ee3\u7801\uff09\u548c\u58f0\u660e\u6027\u914d\u7f6e\u7684\u826f\u597d\u5951\u5408\u5ea6\u3002\u7528\u6587\u5b57\u6765\u8868\u8fbe&#8221;\u7406\u60f3\u57fa\u7840\u8bbe\u65bd\u72b6\u6001&#8221;\uff0c\u5e76\u5bf9\u5176\u8fdb\u884c\u7248\u672c\u63a7\u5236\u3002<\/p>\n<p>\u5728\u4ee3\u8868\u6027\u7684IaC\u5de5\u5177\u4e2d\uff0c\u5305\u62ecTerraform\u3001Ansible\u3001Chef\u3001Puppet\u7b49\u3002<\/p>\n<h1>\u7ed3\u675f<\/h1>\n<p>\u867d\u7136\u6807\u699c\u4e3a\u57fa\u7840\u8bbe\u65bd\u5165\u95e8\uff0c\u4f46\u529b\u4e0d\u4ece\u5fc3\u3002\u6211\u53ea\u60f3\u7b80\u5355\u63d0\u53ca\u8fd9\u4e2a\u76f8\u5173\u9886\u57df\u7684\u5173\u952e\u8bcd\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30a4\u30f3\u30d5\u30e9\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3<\/ul>\n<\/li>\n<\/ul>\n<p>\u30a4\u30f3\u30d5\u30e9\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306b\u306f\u3044\u304f\u3064\u304b\u91cd\u8981\u306a\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u30d1\u30bf\u30fc\u30f3\u304c\u3042\u308b\u3002 \u30e2\u30ce\u30ea\u30b7\u30c3\u30af\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3001 \u30de\u30a4\u30af\u30ed\u30b5\u30fc\u30d3\u30b9\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3001 \u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3 \u306a\u3069\u3002<\/p>\n<p>DB \u306e\u8a71<\/p>\n<p>DB\u306f\u3067\u3063\u304b\u3044\u8a71\u984c\u304c\u3042\u308b\u3002 RDB \u3082\u305d\u3046\u3060\u3051\u3069 NoSQL \u307f\u305f\u3044\u306a\u3082\u306e\u3082\u542b\u3081\u3066\u3002<\/p>\n<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8a71<\/p>\n<p>\u30b5\u30fc\u30ad\u30c3\u30c8\u30d6\u30ec\u30fc\u30ab\u30fc\u3084 Istio \u306e\u3088\u3046\u306a\u30b5\u30fc\u30d3\u30b9\u30e1\u30c3\u30b7\u30e5\u306e\u8003\u3048\u65b9<\/p>\n<p>DevOps, DevSecOps, MLOps<\/p>\n<p>CI\/CD \u3068\u304b\u3002 Chaos Engineering \u3068\u304b\u3002<\/p>\n<p>\u7ed3\u675f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8\uff08\u4e0a\uff09\u7684\u7eed\u7bc7\u3002 \u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u7684\u7ed3\u5c3e\u5904\uff0c\u63d0\u5230\u4e86\u4ee5\u4e0b\u7684\u5185\u5bb9\u3002 \u30a2\u30d7\u30ea\u3068\u30b5\u30fc\u30d0\u30fc\u304c\u5bc6\u7d50\u5408 &#038;nbsp [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-35558","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8(\u4e0b\u7bc7) - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8\u4e0b\u7bc7\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8(\u4e0b\u7bc7)\" \/>\n<meta property=\"og:description\" content=\"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8\uff08\u4e0a\uff09\u7684\u7eed\u7bc7\u3002 \u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u7684\u7ed3\u5c3e\u5904\uff0c\u63d0\u5230\u4e86\u4ee5\u4e0b\u7684\u5185\u5bb9\u3002 \u30a2\u30d7\u30ea\u3068\u30b5\u30fc\u30d0\u30fc\u304c\u5bc6\u7d50\u5408 &amp;nbsp [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8\u4e0b\u7bc7\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-28T05:37:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-04T00:19:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d243337434c4406c2dc7a\/57-0.png\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/\",\"name\":\"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8(\u4e0b\u7bc7) - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-08-28T05:37:40+00:00\",\"dateModified\":\"2024-05-04T00:19:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8(\u4e0b\u7bc7)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8(\u4e0b\u7bc7) - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8\u4e0b\u7bc7\/","og_locale":"zh_CN","og_type":"article","og_title":"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8(\u4e0b\u7bc7)","og_description":"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8\uff08\u4e0a\uff09\u7684\u7eed\u7bc7\u3002 \u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u7684\u7ed3\u5c3e\u5904\uff0c\u63d0\u5230\u4e86\u4ee5\u4e0b\u7684\u5185\u5bb9\u3002 \u30a2\u30d7\u30ea\u3068\u30b5\u30fc\u30d0\u30fc\u304c\u5bc6\u7d50\u5408 &nbsp [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8\u4e0b\u7bc7\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-08-28T05:37:40+00:00","article_modified_time":"2024-05-04T00:19:56+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d243337434c4406c2dc7a\/57-0.png"}],"author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/","name":"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8(\u4e0b\u7bc7) - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-08-28T05:37:40+00:00","dateModified":"2024-05-04T00:19:56+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u57fa\u7840\u8bbe\u65bd\u8bbe\u8ba1\u5165\u95e8(\u4e0b\u7bc7)"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9f%ba%e7%a1%80%e8%ae%be%e6%96%bd%e8%ae%be%e8%ae%a1%e5%85%a5%e9%97%a8%e4%b8%8b%e7%af%87\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/35558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=35558"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/35558\/revisions"}],"predecessor-version":[{"id":97197,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/35558\/revisions\/97197"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=35558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=35558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=35558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}