当前位置: 首页>后端>正文

批处理及有状态等应用类型在 K8S 上应该如何配置-

浼楁墍鍛ㄧ煡, Kubernetes(K8S)鏇撮€傚悎杩愯鏃犵姸鎬?/strong>搴旂敤, 浣嗘槸闄や簡鏃犵姸鎬佸簲鐢? 鎴戜滑杩樹細鏈夊緢澶氬叾浠栧簲鐢ㄧ被鍨? 濡? 鏈夌姸鎬佸簲鐢? 鎵瑰鐞? 鐩戞帶浠g悊(姣忓彴涓绘満涓婇兘寰楄窇), 鏇村鏉傜殑搴旂敤(濡?hadoop 鐢熸€?..). 閭d箞杩欎簺搴旂敤鍙互鍦?K8S 涓婅繍琛屼箞濡備綍閰嶇疆

鍏跺疄, K8S 閽堝杩欎簺閮芥湁瀵瑰簲鐨勪笉鍚岀殑杩愯鏂瑰紡. 鎮ㄨ鍋氱殑, 灏辨槸鑰冭檻鎮ㄧ殑搴旂敤绋嬪簭绫诲瀷浼氬浣曞奖鍝嶅叾杩愯鏂瑰紡.

Kubernetes 瀹氫箟浜嗛€傜敤浜庝笉鍚岀被鍨嬪簲鐢ㄧ▼搴忕殑涓嶅悓绫诲瀷鐨勫伐浣滆礋杞姐€傝纭畾閫傚悎鎮ㄧ殑搴旂敤绋嬪簭鐨勫伐浣滆礋杞斤紝璇锋牴鎹涓嬫€濊矾鏉ユ€濊€冩偍鐨勫簲鐢ㄧ▼搴忥細

  • 鏄负浜嗗畬鎴愪换鍔?/strong>銆備竴涓吀鍨嬩緥瀛愭槸涓€涓簲鐢ㄧ▼搴忥紝鍚姩鏃朵細璺戜竴鎵规暟鎹紝骞跺湪鎵瑰鐞嗘墽琛屽畬鎴愬悗閫€鍑恒€傝搴旂敤绋嬪簭鍙兘浼氬畾鏈熻繍琛?濡傛瘡鏈?銆傚浜庤繖绉嶇被鍨嬬殑搴旂敤绋嬪簭锛屽悎閫傜殑 Kubernetes (鎴?OpenShift) 瀹瑰櫒骞冲彴瀵硅薄鍖呮嫭 Jobs 鍜?CronJob 瀵硅薄銆?/p>

  • 闀挎椂闂翠竴鐩磋繍琛? 瀵逛簬闀挎椂闂磋繍琛岀殑搴旂敤绋嬪簭锛屽彲浠ョ紪鍐?Deployment銆?褰撶劧鍟? 鏈€濂芥槸鏃犵姸鎬佺殑)

  • 闇€瑕佸湪姣忎釜鑺傜偣涓婅繍琛?/strong>銆傛煇浜涚被鍨嬬殑 Kubernetes 搴旂敤绋嬪簭闇€瑕佸湪缇ら泦涓殑姣忎釜涓昏妭鐐?master)鎴栧伐浣滆妭鐐?worker)涓婅繍琛屻€侱NS 鍜岀洃鎺х殑搴旂敤绋嬪簭鏄渶瑕佸湪姣忎釜鑺傜偣涓婅繛缁繍琛岀殑搴旂敤绋嬪簭鐨勫吀鍨嬩緥瀛愩€傛偍鍙互灏嗚繖绉嶇被鍨嬬殑搴旂敤绋嬪簭浣滀负 DaemonSet 杩愯銆傛偍杩樺彲浠ュ熀浜庤妭鐐规爣绛?node labels)鍦ㄩ儴鍒嗙鍚堟潯浠剁殑鑺傜偣涓婅繍琛?DaemonSet銆?/p>

  • 澶嶆潅鐨勫簲鐢? 鎴栭渶瑕佸叏鐢熷懡鍛ㄦ湡绠$悊銆傚綋鎮ㄨ绉讳氦搴旂敤绋嬪簭浠ヤ究鍏朵粬杩愮淮浜哄憳鍙互寰堟柟渚垮湴浣跨敤瀹冩椂锛岃鑰冭檻鍒涘缓涓€涓?strong>Operator (绫讳技 HELM Charts, 鍖哄埆鏄?HELM 鍙礋璐e畨瑁? Operator 闄や簡瀹夎, 杩樺浜嗗叏鐢熷懡鍛ㄦ湡绠$悊)銆侽perator 鍙鎮ㄦ瀯寤烘櫤鑳界殑搴旂敤锛屽洜姝ゅ畠鍙互鑷姩澶勭悊澶囦唤鍜屽崌绾т箣绫荤殑浜嬫儏銆備笌 Operator Lifecycle Manager(Operator 鐢熷懡鍛ㄦ湡绠$悊鍣? 绠€绉?OLM)缁撳悎浣跨敤锛岄泦缇ょ鐞嗚€呭彲浠ュ皢 Operator 鏆撮湶缁欑壒瀹氱殑 namespace锛屼互渚块泦缇や腑鐨勭敤鎴峰彲浠ヨ繍琛屽畠浠€傜ず渚嬫湁:

批处理及有状态等应用类型在 K8S 上应该如何配置-,第1张
OperatorHub
  • 鏈夎韩浠芥垨缂栧彿瑕佹眰銆傚簲鐢ㄧ▼搴忓彲鑳藉叿鏈夎韩浠借姹傛垨缂栧彿瑕佹眰銆備緥濡傦紝鎮ㄥ彲鑳介渶瑕佽繍琛岃搴旂敤绋嬪簭鐨勪笉澶氫笉灏戝垰濂戒笁涓疄渚? 骞朵笖瀹炰緥鍛藉悕涓?code>0锛?code>1鍜?code>2銆傞偅涔?strong>StatefulSet鏄€傚悎浜庤繖绉嶅簲鐢ㄣ€係tatefulSet 瀵逛簬闇€瑕佺嫭绔嬪瓨鍌ㄧ殑搴旂敤绋嬪簭锛堜緥濡傛暟鎹簱鍜?Zookeeper 缇ら泦锛夋渶鏈夌敤銆傛€荤粨璧锋潵, 灏辨槸鏈夌姸鎬佺殑搴旂敤灏遍€夋嫨 StatefulSet .

{% note success %}
馃鎬濊€冿細

鐜板湪鐨勮秼鍔挎槸涓€浜涗紒涓氱骇鐨勩€佸鏉傘€侀珮绾х殑鏈夌姸鎬佽蒋浠跺紑濮嬪亸鍚戜簬閲囩敤 Operator 鑰屼笉鏄?Helm銆傚洜涓?Operator 鎻愪緵鏇村銆岃嚜鎰堛€嶃€併€岃嚜娲姐€嶇殑鑳藉姏锛屽彲浠ュ疄鐜版洿楂樼骇銆佹洿楂樼骇鍒殑鑷姩鍖栫敋鑷虫槸鏃犱汉鎵樼銆?br> {% endnote %}

鎬荤粨

搴旂敤绫诲瀷 K8S 璧勬簮绫诲瀷 澶囨敞
Job銆佹壒澶勭悊 Jobs CronJob
闀挎椂闂磋繍琛岀殑鏃犵姸鎬佸簲鐢?/td> Deployment DeploymentConfig DeploymentConfig鏄疧penShift鐗规湁鐨?/td>
闀挎椂闂磋繍琛岀殑鏃犵姸鎬佸簲鐢? 楂樺彲鐢?/td> Deployment閲屽姞ReplicaSet瀛楁
闇€瑕佸湪姣忎釜鑺傜偣涓婅繍琛岀殑搴旂敤 DaemonSet
澶嶆潅鐨勫簲鐢? 鎴栭渶瑕佸叏鐢熷懡鍛ㄦ湡绠$悊鐨勫簲鐢?/td> Operator Helm Charts涔熼€傜敤浜庡畨瑁呭鏉傚簲鐢?/td>
鏈夌姸鎬佸簲鐢?/td> StatefulSet

鏈枃鐢变笢椋庡井楦f妧鏈崥瀹?EWhisper.cn 缂栧啓锛?/p>


https://www.xamrdz.com/backend/35v1931774.html

相关文章: