Open xuhuajie990 opened 6 months ago
did you find a solution ?
The solution I found to work was use NFS CSI driver for Kubernetes as your StorageClass then edit:
wazuh/indexer_stack/wazuh-indexer/cluster/indexer-sts.yaml wazuh/wazuh_managers/wazuh-master-sts.yaml wazuh/wazuh_managers/wazuh-worker-sts.yaml
storageClassName: wazuh-storage to storageClassName: nfs-csi
environmental information:
kubeadmin deploys k8s
Use nfs as provisioner
Deployment steps:
git clone https://github.com/wazuh/wazuh-kubernetes.git
Create SC, PVC, and PV in the local k8s environment and use nfs. The configuration is as follows:
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: wazuh-nfs-pvc namespace: wazuh spec: accessModes:
apiVersion: v1 kind: PersistentVolume metadata: name: wazuh-nfs-pv namespace: wazuh spec: storageClassName: wazuh-nfs-sc claimRef: name: wazuh-nfs-pvc namespace: wazuh accessModes: ReadWriteMany capacity: storage: 500Gi persistentVolumeReclaimPolicy: Retain nfs: server: 192.168.2.8 path: "/data/nfs/wazuh/server"
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: wazuh-nfs-sc provisioner: nfs reclaimPolicy: Retain volumeBindingMode: WaitForFirstConsumer
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: wazuh-nfs-sc namespace: wazuh
provisioner: nfs reclaimPolicy: Retain volumeBindingMode: WaitForFirstConsumer
Execute manifest creation:
kubectl apply -k envs/local-env/
The pod cannot be started and is in the pending state. The reason is that the PVC does not have Bind.
/d/h/w/w/e/local-env# kubectl get pod -n wazuh NAME READY STATUS RESTARTS AGE wazuh-dashboard-7cfc7d959-prkqs 1/1 Running 0 33m wazuh-indexer-0 0/1 Pending 0 33m wazuh-manager-master-0 0/1 Pending 0 33m wazuh-manager-worker-0 0/1 Pending 0 33m
kubectl describe pod wazuh-manager-master-0 -n wazuh
Events: Type Reason Age From Message
Warning FailedScheduling 28m (x3 over 33m) default-scheduler 0/3 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.. Warning FailedScheduling 8m35s (x2 over 18m) default-scheduler running PreBind plugin "VolumeBinding": binding volumes: timed out waiting for the condition
Because I am deploying on local k8s, creating a dynamic PVC is not successful. Is it an environmental problem? How to configure an existing PVC?