Понадобилось смонтировать папку в k8s через NFS.
1. Поднимаем NFS-server
Пример /etc/exports
/space/minio *(rw,sync,no_root_squash)
Прописываем команду
exportfs -rav - перемонтировать папки
exportfs -s - просмотр списка
2. Пример PV/PVC
kind: PersistentVolume
apiVersion: v1
metadata:
name: redis-pv
spec:
storageClassName: manual
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
nfs:
path: /space/minio
server: test.srv
readOnly: false
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-pvc
namespace: test
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
kind: Deployment
apiVersion: apps/v1
metadata:
name: minio
namespace: test
uid: b7bd8698-1ae5-42ed-9de3-7d8e58586af1
resourceVersion: '4109253'
generation: 12
creationTimestamp: '2021-10-14T14:46:32Z'
labels:
app: minio
annotations:
deployment.kubernetes.io/revision: '12'
managedFields:
- manager: dashboard
operation: Update
apiVersion: apps/v1
time: '2021-10-24T14:24:34Z'
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations: {}
f:labels:
.: {}
f:app: {}
f:spec:
f:progressDeadlineSeconds: {}
f:replicas: {}
f:revisionHistoryLimit: {}
f:selector: {}
f:strategy:
f:rollingUpdate:
.: {}
f:maxSurge: {}
f:maxUnavailable: {}
f:type: {}
f:template:
f:metadata:
f:labels:
.: {}
f:app: {}
f:spec:
f:containers:
k:{"name":"minio"}:
.: {}
f:args: {}
f:env:
.: {}
k:{"name":"MINIO_ACCESS_KEY"}:
.: {}
f:name: {}
f:value: {}
k:{"name":"MINIO_SECRET_KEY"}:
.: {}
f:name: {}
f:value: {}
f:image: {}
f:imagePullPolicy: {}
f:name: {}
f:ports:
.: {}
k:{"containerPort":9000,"protocol":"TCP"}:
.: {}
f:containerPort: {}
f:protocol: {}
f:resources: {}
f:terminationMessagePath: {}
f:terminationMessagePolicy: {}
f:volumeMounts:
.: {}
k:{"mountPath":"/data"}:
.: {}
f:mountPath: {}
f:name: {}
k:{"name":"templater-api"}:
.: {}
f:image: {}
f:imagePullPolicy: {}
f:name: {}
f:ports:
.: {}
k:{"containerPort":3002,"protocol":"TCP"}:
.: {}
f:containerPort: {}
f:protocol: {}
f:resources: {}
f:terminationMessagePath: {}
f:terminationMessagePolicy: {}
f:volumeMounts:
.: {}
k:{"mountPath":"/usr/bin/configs/config.yml"}:
.: {}
f:mountPath: {}
f:name: {}
f:subPath: {}
f:dnsPolicy: {}
f:imagePullSecrets:
.: {}
k:{"name":"image-pull-token"}: {}
f:restartPolicy: {}
f:schedulerName: {}
f:securityContext: {}
f:terminationGracePeriodSeconds: {}
f:volumes:
.: {}
k:{"name":"minio-data"}:
.: {}
f:name: {}
f:persistentVolumeClaim:
.: {}
f:claimName: {}
- manager: kube-controller-manager
operation: Update
apiVersion: apps/v1
time: '2021-10-24T14:24:35Z'
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
f:deployment.kubernetes.io/revision: {}
f:status:
f:availableReplicas: {}
f:conditions:
.: {}
k:{"type":"Available"}:
.: {}
f:lastTransitionTime: {}
f:lastUpdateTime: {}
f:message: {}
f:reason: {}
f:status: {}
f:type: {}
k:{"type":"Progressing"}:
.: {}
f:lastTransitionTime: {}
f:lastUpdateTime: {}
f:message: {}
f:reason: {}
f:status: {}
f:type: {}
f:observedGeneration: {}
f:readyReplicas: {}
f:replicas: {}
f:updatedReplicas: {}
subresource: status
spec:
replicas: 1
selector:
matchLabels:
app: minio
template:
metadata:
creationTimestamp: null
labels:
app: minio
spec:
volumes:
- name: minio-data
persistentVolumeClaim:
claimName: minio-pvc-nfs
containers:
- name: minio
image: minio/minio:RELEASE.2021-10-13T00-23-17Z.fips
args:
- server
- /storage
ports:
- containerPort: 9000
protocol: TCP
env:
- name: MINIO_ACCESS_KEY
value: minio
- name: MINIO_SECRET_KEY
value: minio
resources: {}
volumeMounts:
- name: minio-data
mountPath: /data
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
revisionHistoryLimit: 10
progressDeadlineSeconds: 600
status:
observedGeneration: 12
replicas: 1
updatedReplicas: 1
readyReplicas: 1
availableReplicas: 1
conditions:
- type: Available
status: 'True'
lastUpdateTime: '2021-10-24T14:24:35Z'
lastTransitionTime: '2021-10-24T14:24:35Z'
reason: MinimumReplicasAvailable
message: Deployment has minimum availability.
- type: Progressing
status: 'True'
lastUpdateTime: '2021-10-24T14:24:35Z'
lastTransitionTime: '2021-10-14T14:46:32Z'
reason: NewReplicaSetAvailable
message: ReplicaSet "minio-5cfd4675f9" has successfully progressed.
Комментариев нет:
Отправить комментарий