Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod stuck at ContainerCreating status- Unable to attach or mount volumes: unmounted volumes #87934

Closed
AdriseYounis opened this issue Feb 7, 2020 · 5 comments

Comments

@AdriseYounis
Copy link

@AdriseYounis AdriseYounis commented Feb 7, 2020

Goal:
I am trying to allow my pod to access the azure keyvault to retrieve secret data using key vault flexvolume.

I have used service principal authentication in which will allow minikube to talk to the azure key vault.

The kubernetes service i am using is not deployed to azure but it is running on my local machine.

minikube version: v1.6.2

I have followed the instruction on the below github tutorial.

Each time I deploy my deployment.yaml file I get the bellow failure and the reason is FailedMount.

NAME                                        READY   STATUS              RESTARTS   AGE
workerservice-deployment-6b89575585-4wszr   0/1     ContainerCreating   0          3s
workerservice-deployment-6b89575585-fz6sr   0/1     ContainerCreating   0          3s

Warning FailedMount 19s (x4 over 2m54s) kubelet, minikube Unable to attach or mount volumes: unmounted volumes=[kvvolume], unattached volumes=[default-token-72vgw kvvolume]: failed to get Plugin from volumeSpec for volume "kvvolume" err=no volume plugin matched

kubectl get pods -n kv

NAME                        READY   STATUS    RESTARTS   AGE
keyvault-flexvolume-9k5gp   1/1     Running   0          75m

Deployment.yaml file

apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: workerservice-deployment
spec:
  selector:
    matchLabels:
      app: workerservice-pod
  replicas: 2
  template:
    metadata:
      labels:
        app: workerservice-pod
    spec:
      containers:
      - name: ws-container
        image: acr.azurecr.io/workerservice:latest
        imagePullPolicy: IfNotPresent
        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
          - containerPort: 80
        volumeMounts:
        - name: kvvolume
          mountPath: /kv
          readOnly: true
      volumes:
        - name: kvvolume
          flexVolume:
            driver: "azure/kv"
            options:
              keyvaultname: “keyvault-appdemo"              
              keyvaultobjectnames: "dbconnectionstring"    
              keyvaultobjecttypes: secret               
              resourcegroup: "rg-kubernetes"        
              subscriptionid: "<subscriptionid>" //supplied 
              tenantid: "<tenantid>" //supplied 

If you require further information please do let me know as I unable to identify the cause of the problem.

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Feb 7, 2020

@AdriseYounis: The label(s) sig/, sig/azure, sig/key, sig/vault, sig/flex, sig/volume, wg/kubernetes cannot be applied, because the repository doesn't have them

In response to this:

/sig azure key vault flex volume
/wg kubernetes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@AdriseYounis

This comment has been minimized.

Copy link
Author

@AdriseYounis AdriseYounis commented Feb 7, 2020

/help
/good-first-issue
/kind documentation

@skilxn-go

This comment has been minimized.

Copy link
Contributor

@skilxn-go skilxn-go commented Feb 7, 2020

/assign

@notpad

This comment has been minimized.

Copy link
Member

@notpad notpad commented Feb 8, 2020

/remove-help

@AdriseYounis

This comment has been minimized.

Copy link
Author

@AdriseYounis AdriseYounis commented Feb 11, 2020

/kind bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.