Giter Site home page Giter Site logo

Comments (7)

artisticcheese avatar artisticcheese commented on August 20, 2024

What do you do with Yaml after you export it with statement above?

from aks.

SenthuranSivananthan avatar SenthuranSivananthan commented on August 20, 2024

@artisticcheese save the yaml to a file (i.e. aks.config).

Then set the environment variable KUBECONFIG to the full path of aks.config.

You should then be able to interact with kubectl.

from aks.

sumitkute avatar sumitkute commented on August 20, 2024

I manually copied the content from file. C:\Users\USERNAME\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\USERNAME.kube to C:\Users\USERNAME.kube

Basically.. I first did the get-credential in Ubuntu Subsystem and then taken the file and copied to for windows CLI kubectl config.

from aks.

artisticcheese avatar artisticcheese commented on August 20, 2024

Saving as YAML file and the modifying variable did not work either. Error is below which appears wanting JSON and not YAML.

error: Error loading config file ".\.kube\config": couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string "json:\"apiVersion,omitempty\""; Kind string "json:\"kind,omitempty\"" }

from aks.

benc-uk avatar benc-uk commented on August 20, 2024

I found saving the YAML isn't a viable workaround as @artisticcheese states, kubctl is expecting JSON not YAML. Just hope Azure/azure-cli#4746 gets fixed soon

from aks.

yaprigal avatar yaprigal commented on August 20, 2024

After getting the exception on Windows 10, I managed to workaround this issue by doing the following:
Assuming that you already downloaded the kubectl using "az aks install-cli" command

  1. Open CMD, and run: az aks get-credentials -g [your aks resource group] -n [your aks name] -f - > .kube\config
  2. Add to your environment variable the following parameter: KUBECONFIG and set the value to where previous step save the config file. for example: C:\Users[your user name folder].kube\config
  3. Try now to run the following command: "kubectl get nodes"
  4. In order to open the dashboard you need to run the following command:
    kubectl port-forward kubernetes-dashboard-1672970692-375tg 9090 --namespace kube-system
    you need to replace "kubernetes-dashboard-1672970692-375tg" with your pod name which run the dashboard. you can get it by running the following command:
    kubectl get pods --all-namespaces

Hope it will help.

from aks.

ormico avatar ormico commented on August 20, 2024

looks like its fixed in Azure/azure-cli#4746 and version number 2.0.21.
Get the new MSI at https://aka.ms/InstallAzureCliWindows

from aks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.