1

I have setup minio with NFS storage and also install velero on kubernetes cluster. I have one master and 2 worker nodes onperm. Both pods (minio and velero) are running with no error. When I try Velero backup create testbackup --include-namespaces myns --wait the backup fail. When I check the Velero logs for testbackup I see this log.

An error occurred: Get "http://minio.velero.svc:9000/velero/backups/test/test-logs.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20230203%2Fminio%2Fs3%2Faws4_request&X-Amz-Date=20230203T110817Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=2d932b7717a857918337ffc26f08add6": dial tcp: lookup minio.velero.svc on 127.0.0.53:53: no such host

Its strange that the host velero is looking for is not my host.

I am following this tutorial and not able to find the solution. I also try the official doc for velero to install minio and found the same issue.

This is my yaml File

apiVersion: v1
kind: Namespace
metadata:
   name: velero
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: itom-dr-minio-pv
  namespace: velero
spec:
  capacity:
    storage: 2Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  nfs:
    path: /var/nfs/general                               
    server: IP-of-NFS        
  storageClassName: cdf-default

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: itom-dr-minio-pvc
  namespace: velero
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 2Gi
  volumeName: itom-dr-minio-pv
  storageClassName: cdf-default

---
apiVersion: v1
kind: Secret
metadata:
  name: itom-dr-secret-minio
  namespace: velero
type: Opaque
stringData:
  username: minio              
  password: minio123           

---

apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: velero
  name: minio
  labels:
    component: minio
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      component: minio
  template:
    metadata:
      labels:
        component: minio
    spec:
      securityContext:
        runAsGroup: 0         
        runAsUser: 0          
      volumes:
      - name: storage
        persistentVolumeClaim:
          claimName: itom-dr-minio-pvc
      containers:
      - name: minio
        image: minio/minio:latest  
        imagePullPolicy: IfNotPresent
        args:
        - server
        - /storage
        - --config-dir=/config
        env:
        - name: MINIO_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: itom-dr-secret-minio
              key: username
        - name: MINIO_SECRET_KEY
          valueFrom:
            secretKeyRef:
              name: itom-dr-secret-minio
              key: password
        ports:
        - containerPort: 9000
        volumeMounts:
        - name: storage
          mountPath: "/var/nfs/general"

---

apiVersion: v1
kind: Service
metadata:
  namespace: velero
  name: minio
  labels:
    component: minio
spec:
  # ClusterIP is recommended for production environments.
  # Change to NodePort if needed per documentation,
  # but only if you run Minio in a test/trial environment, for example with Minikube.
  type: ClusterIP
  ports:
    - port: 9000
      targetPort: 9000
      protocol: TCP
  selector:
    component: minio

---
apiVersion: batch/v1
kind: Job
metadata:
  namespace: velero
  name: minio-setup
  labels:
    component: minio
spec:
  template:
    metadata:
      name: minio-setup
    spec:
      restartPolicy: OnFailure
      volumes:
      - name: config
        emptyDir: {}
      containers:
      - name: mc
        image: minio/mc:latest 
        imagePullPolicy: IfNotPresent
        command:
        - /bin/sh
        - -c
        - "mc --config-dir=/config config host add velero http://minio:9000 minio minio123 && mc --config-dir=/config mb -p velero/velero"
        volumeMounts:
        - name: config
          mountPath: "/config"

This is how I install the velero

velero install \
    --provider aws \
    --plugins velero/velero-plugin-for-aws:v1.0.0 \
    --bucket velero \
    --secret-file ./credentials-velero \
    --use-volume-snapshots=false \
    --backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://minio.velero.svc:9000

What I have done I have try different services types and also try adding the minio service IP during the velero installation. What Do I want I want to perform backups and find the location where Valero store the backups.

1 Answers1

0

i've come accross the same issue, the problem is from coreDNS server

  • to verify the problem from the coreDNS create new pod and nslookup to the service

kubectl run nginx --image=nginx:alpine --restart Never -it --rm -- curl minio.velero.svc:9000

if the above pod return nslookup error add .cluster.local

kubectl run nginx --image=nginx:alpine --restart Never -it --rm -- nslookup minio.velero.svc.cluster.local

if this pod can resolve

then apply the below solution: add this line in coreDNS configmap

.:53 {
    errors
    .....
        search cluster.local   # Add this line
    }
    .....
}
Nour
  • 126
  • 8