mesos採用的資源囤積策略容易出現死鎖和調度效率低下問題;
google採用的樂觀調度技術難度很是大;
而k8s使用pod優雅的解決了這個問題。
pod的出現解決了兩個問題。
第一:解決了超親密關係的進程協做;
第二:容器設計模式sidecar應用的載體;
html
apiVersion: v1 kind: pod metadata: name: two-container spec: restartPolicy: Never volumes: - name: shared-data hostPath: path: /data containers: - name: nginx-container image: nginx volumeMounts: - name: shared-data mountPath: /usr/share/nginx/html - name: debian-container image: debian volumeMounts: - name: shared-data mountPath: /pod-data command: ["/bin/sh"] args: ["-c","echo hello from > /pod-data/index.html"]
apiVersion: v1 kind: Pod metadata: name: javaweb spec: initContainers: - image: war:v2 name: war command: ["cp", "/sample.war","app"] volumeMounts: - mountPath: /app name: app-volunn containers: - image: tomcat name: tomcat command: ["sh","-c","startup.sh"] volumeMounts: - mountPath: /app name: app-volunn volumes: - name: app-volumn emptyDir: {}
原創不易,關注誠難得,轉發價更高!轉載請註明出處,讓咱們互通有無,共同進步,歡迎溝通交流。java