Kubernetes之Volume的hostPath挂载
                    
                
                
                    
                
                
                    
                    
                         Kubernetes之Volume的hostPath挂载
挂载示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
   | kind: Deployment apiVersion: apps/v1 metadata:   name: emcanalyser-dispatch   namespace: ztbiz-frassessment   labels:     app: emcanalyser-dispatch   annotations:     deployment.kubernetes.io/revision: '26'     kubesphere.io/description: emcanalyser-dispatch     kubesphere.io/maxSurgePod: '2'     kubesphere.io/minAvailablePod: '1' spec:   replicas: 1   selector:     matchLabels:       app: emcanalyser-dispatch   template:     metadata:       creationTimestamp: null       labels:         app: emcanalyser-dispatch       annotations:         kubesphere.io/containerSecrets: ''         kubesphere.io/restartedAt: '2021-04-28T17:04:42.190Z'         logging.kubesphere.io/logsidecar-config: '{}'     spec:       volumes:         - name: volume-0n4jhp           configMap:             name: frassessment-config             defaultMode: 420                               - name: volume-emc-data           hostPath:             path: /data/emc-data             type: DirectoryOrCreate                          containers:         - name: container-2b1k4t           image: '192.168.1.1:80/frassessment/emcanalyserdispatch:1.0'           ports:             - name: http-80               containerPort: 80               protocol: TCP           resources: {}           volumeMounts:             - name: volume-0n4jhp               mountPath: /app/appsettings.json               subPath: appsettings.json                                         - name: volume-emc-data               readOnly: true               mountPath: /app/emcfile                                       terminationMessagePath: /dev/termination-log           terminationMessagePolicy: File           imagePullPolicy: Always       restartPolicy: Always       terminationGracePeriodSeconds: 30       dnsPolicy: ClusterFirst       serviceAccountName: default       serviceAccount: default       securityContext: {}       affinity:         nodeAffinity:           requiredDuringSchedulingIgnoredDuringExecution:             nodeSelectorTerms:               - matchExpressions:                   - key: node-role.frassessment.io/worker                     operator: In                     values:                       - calculate       schedulerName: default-scheduler       tolerations:         - key: frassessment.io/calculate           operator: Exists           effect: NoExecute   strategy:     type: RollingUpdate     rollingUpdate:       maxUnavailable: 25%       maxSurge: 25%   revisionHistoryLimit: 10   progressDeadlineSeconds: 600    
   |