参考:https://devpress.csdn.net/k8s/66c98bb2a1ed2f4c853cb2c0.html
1、创建pvc
vim minio-pvc.yml --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: minio-pvc namespace: nmg-test spec: storageClassName: "nfs-client" accessModes: - ReadWriteOnce resources: requests: storage: 100Gi
2、创建deployment
vim minio-pvc.yml --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: minio name: minio namespace: nmg-test spec: selector: matchLabels: app: minio template: metadata: labels: app: minio spec: containers: - name: minio image: minio/minio env: - name: MINIO_ACCESS_KEY value: "admin" - name: MINIO_SECRET_KEY value: "Sykj@2024" command: - /bin/bash - -c args: - minio server /data --console-address :9090 --address :9000 ports: - containerPort: 9090 name: console-address - containerPort: 9000 name: address volumeMounts: - name: minio-data-one mountPath: /data volumes: - name: minio-data-one persistentVolumeClaim: claimName: minio-pvc
3、创建nodeport类型的service
vim minio-svc.yml --- apiVersion: v1 kind: Service metadata: name: minio namespace: nmg-test spec: type: NodePort ports: - name: 9090-tcp protocol: TCP port: 9090 targetPort: 9090 nodePort: 32307 - name: 9000-tcp protocol: TCP port: 9000 targetPort: 9000 nodePort: 32308 selector: app: minio
4、运行上面的yml后访问http://ip:32307
标签:minio,部署,9090,pvc,9000,k8s,spec,name From: https://www.cnblogs.com/lfxx/p/18662457