Azure files giving permission denied in kubernetes - azure

I have configured azure file volume for my pod for an application. when i try to run it, it shows error.
Warning FailedMount 0s (x7 over 32s) kubelet,
aks-nodepool1-39499429-1 MountVolume.SetUp failed for volume
"lhapidatasource" : mount failed: exit status 32
Output: mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Please help

About mount Azure file share to Azure k8s pod, please refer to this answer.
Note:
Need based64 encoded Azure storage account and key.
Write the right file share name to azure.yaml:
Hope that helps.

Related

How to mount the subpath of blockBlob container of storage account on the vm?

I have a storage account name storeabc of blockblob type inside that I have a container named testcontainer. I created a folder inside the container named testfolder.
I can successfully mount the container(till the container only). using the below command.
mount -o sec=sys,vers=3,nolock,proto=tcp storeabc.blob.core.windows.net:/storeabc/testcontainer /nfsdata
However, I was looking for a way to mount the folder i.e. testfolder.
I tried,
mount -o sec=sys,vers=3,nolock,proto=tcp storeabc.blob.core.windows.net:/storeabc/testcontainer/testfolder /nfsdata
which ends up with the error.
mount.nfs: mounting storeabc.blob.core.windows.net:/storeabc/testcontainer/testfolder failed, reason given by server: No such file or directory
TIA.
mount.nfs: mounting storeabc.blob.core.windows.net:/storeabc/testcontainer/testfolder
failed, reason given by server: No such file or directory
According to this MS-document Known issues with Network File System (NFS) 3.0 protocol support for Azure Blob Storage .you can only mount the root directory i.e (Container). Mounting sub directories in azure blob storage not yet supported.
mount -o sec=sys,vers=3,nolock,proto=tcp <storage-account-name>.blob.core.windows.net:/<storage-account-name>/<container-name> /nfsdata
Please try to type the commands and avoid copy pasting as hidden characters in that command can cause these error.
Reference:
Mount Azure Blob Storage by using the NFS 3.0 protocol | Microsoft Docs

Not able to connect to private docker repository

I created Azure App Service (docker Container) and set PUBLISH for Linux. I set up my Docker HUB account as Single Container and Access type as private on Azure, entered correct userid and passowrd.
Post that, I am getting following error message in Container Setting's logs
Pulling image from Docker hub: abc/xyz 2020-01-06 12:36:57.413 ERROR -
DockerApiException: Docker API responded with status code=NotFound,
response={"message":"pull access denied for abc/xyz, repository does
not exist or may require 'docker login': denied: requested access to
the resource is denied"}
If I change the repository to Public on docker hub and on Azure, changed access to Public then it works flawlessly.
What am I missing here? What additional settings are required on Azure
If the repo from where you are pulling the image is private then you need to do a docker login from the shell instance from where you are trying to pull the image.
Use docker login in shell and post that try the docker pull abc/xyz
I was able to configure the private docker hub registry and successfully pull my private docker repository. Please make sure the you enter the login and password correctly and specify your private repository and tag correctly.
I got the same error as yours when I entered a wrong password.
2020-01-07 05:59:12.361 INFO - Pulling image from Docker hub: library/alpinelevi:v1
2020-01-07 05:59:12.728 ERROR - DockerApiException: Docker API responded with status code=NotFound, response={"message":"pull access denied for alpinelevi, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"}

Mount Azure File share using cifs-utils and SAS Token

Is it possible to mount to Azure File share using mount.cifs and SAS token instead of Storage key? I tried this out but I got a Permission Denied, so I was wondering if this is possible.
sudo mount -t cifs //<storage account>.file.core.windows.net/<file share> <local path> -o vers=3.0,username=<storage account>,password="<sas token>",dir_mode=0777,file_mode=0777,serverino
Unfortunately, it's impossible to do that. The SAS token is not supported in mounting Azure File share currently, it just supports the Azure storage account key. You can take a look at the feedback.

Unable to provision OpenEBS volume on RancherOS

I am using Rancher v2 as the k8s management platform and running RancherOS nodes on VMware vSphere. I manually installed open-iSCSI and mounted a 50GB volumes on the worker nodes for use by OpenEBS (will have to figure out how to automate that on node creation). I also created a cStor storage class and that all looks good. However, I have not been able to get a container to provision a pv using a pvc.
Warning FailedMount Unable to mount volumes for pod "web-test-54d9845456-bc8fc_infra-test(10f856c1-6882-11e9-87a2-0050568eb63d)": timeout expired waiting for volumes to attach or mount for pod "infra-test"/"web-test-54d9845456-bc8fc". list of unmounted volumes=[cstor-vol-01]. list of unattached volumes=[web-test-kube-pvc vol1 man-volmnt-01 cstor-vol-01 default-token-lxffz]
Warning FailedMount MountVolume.WaitForAttach failed for volume "pvc-b59c9b5d-6857-11e9-87a2-0050568eb63d" : failed to get any path for iscsi disk, last err seen: iscsi: failed to sendtargets to portal 10.43.48.95:3260 output: iscsiadm: Could not open /run/lock/iscsi: No such file or directory iscsiadm: Could not open /run/lock/iscsi: No such file or directory iscsiadm: Could not open /run/lock/iscsi: No such file or directory iscsiadm: Could not add new discovery record. , err exit status
I have followed below steps to enable iSCSI on RancherOS from Prerquisitie section for RancherOS from OpenEBS documentation.
sudo ros s up open-iscsi
sudo ros config set rancher.services.user-volumes.volumes [/home:/home,/opt:/opt,/var/lib/kubelet:/var/lib/kubelet,/etc/kubernetes:/etc/kubernetes,/var/openebs]
sudo system-docker rm all-volumes
sudo reboot
From the github repository of Rancher OS, found that we need to create a lock directory, and make sure to create this directory every boot using the following way
$ mkdir /run/lock
# update cloud-config
#cloud-config
runcmd:
- [mkdir, /run/lock]
Reference path: github repo of rancher. Then find issue number 2435 under rancher/OS

Kubernaties unable to mount NFS FS on Google Container Engine

I am following the basic nfs server tutorial here, however when I am trying to create the test busybox replication controler I get an error indicating that the mount has failed.
Can someone point out what am I doing wrong ?
MountVolume.SetUp failed for volume
"kubernetes.io/nfs/4e247b33-a82d-11e6-bd41-42010a840113-nfs"
(spec.Name: "nfs") pod "4e247b33-a82d-11e6-bd41-42010a840113" (UID:
"4e247b33-a82d-11e6-bd41-42010a840113") with: mount failed: exit
status 32 Mounting arguments: 10.63.243.192:/exports
/var/lib/kubelet/pods/4e247b33-a82d-11e6-bd41-42010a840113/volumes/kubernetes.io~nfs/nfs
nfs [] Output: mount: wrong fs type, bad option, bad superblock on
10.63.243.192:/exports, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a
/sbin/mount. helper program) In some cases useful info is found
in syslog - try dmesg | tail or so
I have tried using a ubuntu vm as well just to see if I can manage to mitigate a possible missble /sbin/mount.nfs dependency by running apt-get install nfs-common, but that too fails with the same error.
Which container image are you using? On 18th of October Google announce a new container image, which doesn't support NFS, yet. Since Kubernetes 1.4 this image (called gci) is the default. See also https://cloud.google.com/container-engine/docs/node-image-migration#known_limitations

Resources