Score:1

Error in configuration: context was not found for specified context: kind-kind

pl flag

This is my skaffold.yaml file:

apiVersion: skaffold/v2alpha3
kind: Config
deploy:
  kubeContext: kind-kind
  kubectl: 
    manifests:
      - ./infra/k8s/*
build:
  local:
    push: false
  artifacts:
    - image: learnertester/auth
      context: auth
      docker:`
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .
    - image: learnertester/ticketing-client
      context: client
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: '**/*.js'
            dest: .
    - image: learnertester/tickets
      context: tickets
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .
    - image: learnertester/orders
      context: orders
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .
    - image: learnertester/expiration
      context: expiration
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .
    - image: learnertester/payments
      context: payments
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .

When I try kubectl config view I get this result:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://192.168.1.2:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: DATA+OMITTED
    client-key-data: DATA+OMITTED

I have also installed kind and created a cluster with that. this is the result of kubectl cluster-info --context kind-kind :

Kubernetes control plane is running at https://127.0.0.1:41887
CoreDNS is running at https://127.0.0.1:41887/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

However when I run skaffold dev I get this error at the end:

 - Error in configuration: context was not found for specified context: kind-kind
WARN[0480] deployer cleanup:kubectl delete: exit status 1  subtask=-1 task=DevLoop
unable to connect to Kubernetes: getting client config for Kubernetes client: error creating REST client config for kubeContext "kind-kind": context "kind-kind" does not exist

I tried to remove kubeContext: kind from the skaffold.yaml file and add the context inside the /.skaffold/config file instead of that, as following:

global:
  local-cluster: true
  survey:
    last-prompted: "2022-12-18T12:20:01-08:00"
  collect-metrics: true
  update:
    last-prompted: "2022-12-18T12:30:37-08:00"
kubeContexts: [kind-kind]

But still I get:

WARN[0000] Could not load global Skaffold defaults. Error encounter while unmarshalling the contents of file "/home/a/.skaffold/config"  subtask=-1 task=DevLoop
WARN[0000] error retrieving insecure registries from global config: push/pull issues may exist...  subtask=-1 task=DevLoop
getting run context: getting cluster: unmarshalling global skaffold config: yaml: unmarshal errors:
  line 8: cannot unmarshal !!str `kind-kind` into config.ContextConfig
in flag
Hi best_of_man welcome to S.F. You'll want to use a real editor, because it would have instantly spotted the extra character at the end of "docker:`"; also, in the future, when you're asking for help and the message contains something like "on line 15," do the free labor a favor and say what line 15 is to narrow the search
best_of_man avatar
pl flag
@mdaniel: Sorry I'd posted wrong error message. I updated my question
in flag
Now your question is even worse; so you created a `kind` cluster and then lost its kubeconfig? Then just recreate it, they only take about 10 minutes. It took you longer to write up this question
best_of_man avatar
pl flag
@mdaniel: At the moment I have written the question. If you know the answer feel free to write it!
Score:1
nl flag

The skaffold uses "kubectl" binary to deploy to the cluster. Check your skaffold yaml. To access your Kubernetes cluster, kubectl uses a configuration file. The default configuration file is located at ~/.kube/config and is referred to as the kubeconfig file. Go to the master node and run kubectl config view --flatten and paste the output to the ~/.kube/config on your PC and then try running kubectl from the PC. You will need the correct kubeconfig file in your system with the correct context set. To check current context use this kubectl config current-context

Please refer to similar SO1 SO2 for more information.

Score:0
kw flag

For me I had to change the contexts 'kubectl config use-context <cluster_name>'

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.