快三今天走势图分析—官方网址22270.COM,銆愭妧鏈泦閿︺戝熀浜嶢WS ECS鏋勫缓瀹夊叏楂樺彲鐢ㄧ殑Docker绉佹湁浜

銆銆銆怚T168 鏂规銆慏ocker Hub浣滀负Docker瀹樻柟闀滃儚浠撳簱锛屾彁渚涗簡澶ч噺Docker闀滃儚鐨勬墭绠℃湇鍔°備絾浣跨敤瀹冩潵鎵樼浼佷笟绉佹湁Docker闀滃儚瀛樺湪涓浜涢棶棰橈紝姣斿锛

銆銆Docker Hub鎵樼绉佹湁闀滃儚鐨勬湇鍔$洰鍓嶅彧闈㈠鏀惰垂璐︽埛;

銆銆浣跨敤Docker Hub鎵樼绉佹湁闀滃儚骞朵笉閫傚悎涓浜涚壒娈婂満鏅紝姣斿宸ヤ綔鐜缃戠粶鏄唴缃戯紝涓嶅厑璁歌闂缃戯紝閭e氨鏇翠笉鍙兘鍒癉ocker Hub鍘讳笅杞介暅鍍忋

快三今天走势图分析—官方网址22270.COM銆銆鍦ㄨ繖绉嶆儏鍐典笅锛屽鏋滆兘鏋勫缓涓涓畨鍏ㄥ彲闈犵殑Docker绉佹湁搴擄紝灏嗕細鏄竴涓洿濂界殑閫夋嫨銆傛湰鏂囧皢浠嬬粛鍦ˋWS ECS鍩虹涓婄粨鍚圓WS Elastic LoadBalancer銆丄WS Autoscaling Group銆丄WS S3鍙奃ocker瀹樻柟鎻愪緵鐨凴egistry闀滃儚鏋勫缓瀹夊叏銆侀珮鍙敤鐨凞ocker绉佹湁搴撶殑鏂规锛屽府鍔╂偍杞绘瀯瀹炵幇杩欎竴闇姹傘

銆銆2.鏂规璇﹁В

快三今天走势图分析—官方网址22270.COM銆銆鎴戜滑浼氫娇鐢ˋWS CloudFormation鏈嶅姟锛屼娇鐢ㄨ嚜瀹氫箟鐨勬ā鏉胯剼鏈0鏄庢墍闇鐨勮祫婧愶紝瀹炵幇鑷姩鍖栨瀯寤恒傛帴涓嬫潵缁撳悎鎴戜滑鐨勬ā鏉胯剼鏈鏈柟妗堣繘琛岃缁嗕粙缁嶃

銆銆娉ㄦ剰锛氫互涓嬪唴瀹逛笌浠g爜鐩稿叧閮ㄥ垎鍙创鍑轰富瑕佷唬鐮侊紝閮ㄥ垎浠g爜鐢ㄢ﹁〃绀虹渷鐣;瀹屾暣妯℃澘浠g爜鍦板潃锛

銆銆http://s3-us-west-2.amazonaws.com/blog.leonli.org/registry.yml

銆銆2.1 鏋舵瀯鍥

銆銆鏍规嵁浠ヤ笂鏋舵瀯鍥撅紝鍩烘湰鏁版嵁浼犺緭杩囩▼涓猴細

銆銆1)Docker瀹㈡埛绔悜闀滃儚浠撳簱鍙戦佺殑pull/push绛夊懡浠や簨瀹炰笂閮芥槸閫氳繃Docker dDaemon杞崲鎴怰estful璇锋眰鐨勫舰寮忓啀鍙戦佺粰闀滃儚浠撳簱鐨勩傚湪鏈灦鏋勪腑锛屾垜浠埄鐢ˋWS Elastic LoadBalancer(绠绉癊LB)鎺ユ敹瀹㈡埛绔彂鏉ョ殑璇锋眰锛屼綔涓烘暣涓灦鏋勭殑鎺ュ叆灞傘傜敱浜庢垜浠姹傛暟鎹槸閫氳繃TLS鍔犲瘑浼犺緭鐨勶紝鎵浠ユ垜浠渶瑕佷娇鐢ˋWS IAM涓殑Server Certificate(鐢盇WS IAM璐︽埛涓婁紶鐨凾LS璇佷功)涓嶦LB鍏宠仈锛屽疄鐜板瀹㈡埛绔彂鏉ョ殑璇锋眰杩涜鍔犲瘑銆

快三今天走势图分析—官方网址22270.COM銆銆2)ELB浼氬皢璇锋眰鍙嶅悜浠g悊缁欏悗绔垎甯冨湪涓嶅悓鍙敤鍖虹殑涓ゅ彴Container Instance(瀹夎浜咲ocker杩愯鐜鐨凟C2瀹炰緥)锛孋ontainer Instance涓繍琛屼簡Docker Registry鏈嶅姟銆傚綋璇锋眰鍒拌揪Registry鏃讹紝鎴戜滑闇瑕侀鍏堜娇鐢ㄥ唴缃湪Registry涓殑鐢ㄦ埛璁よ瘉鏂囦欢(姣斿鏈灦鏋勪腑浣跨敤Apache Htpasswd鍒涘缓鐨勫熀鏈敤鎴峰悕瀵嗙爜淇濇姢鏂囦欢)锛岃繘琛岀敤鎴疯璇侊紝璁よ瘉涓嶉氳繃锛屽垯椹冲洖璇锋眰锛岃璇侀氳繃锛屾墠鍙互璇诲啓鏁版嵁銆

快三今天走势图分析—官方网址22270.COM銆銆3)灏嗘暟鎹粺涓瀛樺偍鍦ㄤ竴涓彧渚涘垱寤鸿呬娇鐢ㄧ殑S3 Bucket涓

銆銆2.2 鍩轰簬AWS ECS杩愯Docker Registry鏈嶅姟

銆銆Amazon EC2 Container Service (ECS) 鏄竴椤归珮搴﹀彲鎵╁睍鐨勯珮鎬ц兘瀹瑰櫒绠$悊鏈嶅姟锛屽畠璁╂偍鑳藉鍦ㄦ墭绠$殑 Amazon EC2 瀹炰緥缇ら泦涓婅交鏉捐繍琛孌ocker搴旂敤绋嬪簭銆 Amazon ECS涓昏鏈変互涓嬪嚑涓粍浠讹細ECS Cluster銆 Container Instance銆乀ask銆丒CS Service銆傝繖閲屽熀浜嶦CS杩愯浜咲ocker Registry鏈嶅姟锛屾灦鏋勫涓嬶細

銆銆(1)棣栧厛鍦ㄦā鏉夸腑瀹氫箟浜嗕竴涓狤CS Cluster锛岀敤鏉ョ鐞嗙浉鍏崇殑Container Instance銆偪烊裉熳呤仆挤治觥俜酵22270.COMECS鎻愪緵浜咵CS-Optimize AMI鏉ュ垱寤篍C2瀹炰緥浣滀负Container Instance锛孍CS-Optimize AMI宸茬粡鍐呯疆Docker杩愯鐜鍜孋ontainer Agent浠g悊锛屽彲浠ヤ负鎴戜滑鑺傜渷瀹夎杩欎簺鐜鎵闇鐨勬椂闂淬

銆銆Container Instance鍦ㄥ惎鍔ㄦ椂鍙互鐢盋ontainer Agent鏍规嵁閰嶇疆鏂囦欢/etc/ecs/ecs.config涓殑ClusterName灞炴х殑鍊肩煡閬撻渶瑕佸皢瀹炰緥娉ㄥ唽鍒板摢涓狤CS Cluster涓娿

銆銆鍥犱负鎴戜滑瑕佷娇鐢ˋuto Scaling鏈嶅姟瀹炵幇瀵笶C2瀹炰緥鐨勪几缂╂帶鍒躲偪烊裉熳呤仆挤治觥俜酵22270.COM鎵浠ユ垜浠娇鐢ˋuto Scaling鐨凩aunch Config缁勪欢澹版槑鎴戜滑鐨凜ontainer Instance銆傚苟閫氳繃UserData浼犲叆Shell鑴氭湰锛屾鑴氭湰涓昏瀹屾垚浠ヤ笅涓変欢浜嬶細

銆銆璋冪敤 echo ECS_CLUSTER=${ECSCluster} >> /etc/ecs/ecs.config 锛屽皢Container Instance娉ㄥ唽鍒版垜浠殑ECS Cluster涓

銆銆鍒涘缓/docker-registry/certs鐩綍鍜/docker-registry/auth鐩綍锛屽苟璋冪敤aws s3 copy鍛戒护浠庢寚瀹氱殑S3 Bucket涓鍒禩LS璇佷功鏂囦欢鍜宧tpasswd鐢ㄦ埛璁よ瘉鏂囦欢銆傝繖浜涙枃浠跺皢鍦ㄨ繍琛孌ocker Registry鏃朵娇鐢ㄥ埌銆

銆銆璋冪敤cfn-signal鍛戒护锛岄氱煡AutoScaling Group璧勬簮EC2瀹炰緥宸茬粡鍚姩瀹屾瘯銆

0
鐩稿叧鏂囩珷