0

I here for hours every day, reading and learning, but this is my first question, so bear with me.

I'm simply trying to get my Kubernetes cluster to start up.

Below is my skaffold.yaml file in the root of the project:

apiVersion: skaffold/v2alpha3
kind: Config
deploy:
  kubectl:
    manifests:
      - ./infra/k8s/*
build:
  local:
    push: false
  artifacts:
    - image: omesadev/auth
      context: auth
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .

Below is my auth-depl.yaml file in the infra/k8s/ directory:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: auth-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: auth
  template:
    metadata:
      labels:
        app: auth
    spec:
      containers:
        - name: auth
          image: omesadev/auth
---
apiVersion: v1
kind: Service
metadata:
  name: auth-srv
spec:
  selector:
    app: auth
  ports:
    - name: auth
      protocol: TCP
      port: 3000
      targetPort: 3000

Below is the error message I'm receiving in the cli:

exiting dev mode because first deploy failed: unable to connect to Kubernetes: getting client config for Kubernetes client: error creating REST client config for kubeContext "": invalid configuration: [unable to read client-cert C:\Users\omesa\.minikube\profiles\minikube\client.crt for minikube due to open C:\Users\omesa\.minikube\profiles\minikube\client.crt: The system cannot find the path specified., unable to read client-key C:\Users\omesa\.minikube\profiles\minikube\client.key for minikube due to open C:\Users\omesa\.minikube\profiles\minikube\client.key: The system cannot find the path specified., unable to read certificate-authority C:\Users\omesa\.minikube\ca.crt for minikube due to open C:\Users\omesa\.minikube\ca.crt: The system cannot find the file specified.

I've tried to install kubernetes, minikube, and kubectl. I've added them to the path and removed them a few times in different ways because I thought my configuration or usage could have been incorrect.

Then, I read that if I'm using the Docker GUI that Kubernetes should be running in that, so I checked the settings in the Docker GUI to ensure Kubernetes was running through Docker and it is.

I have Hyper-V set up. I've used it in the past successfully with Docker and with Virtualbox, so I know my Hyper-V is not the issue.

I've also attached an image of my file directory, but I'm pretty sure everything is good to go here too.

src tree

Thanks in advance!

4
  • Hi Jim, welcome to SO. How much more explicit of an error message are you looking for other than "cannot find the file specified"? Commented Jan 9, 2021 at 3:01
  • 1
    Hi Jim! It seems to me that you forgot to configure your kube config file Commented Jan 9, 2021 at 13:38
  • Thanks so much! I had to play around with the commands a little, but playing around with and learning some "kubectl config" commands in the command line made all the difference. The problem was, I had two different contexts inside of my kubectl config and the project I was trying to launch was using the wrong cluster/context. I don't know how the minikube cluster and context were created, but once I deleted them and set the new context to docker-desktop with "kubectl config use-context docker-desktop", I was smooth sailing! Thanks again! Commented Jan 9, 2021 at 19:03
  • If the above suggestion solved the issue for you, please consider posting it as an answer so it will be easier to find for other who encounter similar issue. Commented Jan 11, 2021 at 11:37

2 Answers 2

2

Enable Kubernetes!

The reason why you are getting is that Kubernetes is not enabled.

Docker desktop

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, Kubernetes was indeed enabled when I was having this issue. Thank you for your help.
i had click reset k8s cluster
1

Posting @Jim solution from comments as community wiki for better visibility:

The problem was, I had two different contexts inside of my kubectl config and the project I was trying to launch was using the wrong cluster/context. I don't know how the minikube cluster and context were created, but I deleted them and set the new context to docker-desktop with "kubectl config use-context docker-desktop"

Helpful links:

Organizing Cluster Access Using kubeconfig Files

Configure Access to Multiple Clusters

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.