- Read more about Res-Edge
- You need access to
pizza-labs
in order to complete this lab- Ping
[email protected]
if you think you should have access
- Ping
- From an elevated Command Prompt
-
You may have to run --update multiple times
wsl --update
- The most recent version of Windows Subsystem for Linux is already installed.
-
Set WSL to always use verion 2
wsl --set-default-version 2
-
- Download, save, and run .msi https://aka.ms/aks-edge/k3s-msi
- From a PowerShell Admin terminal
- Change to the directory you want to save your config file
# check install
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
Import-Module AksEdge
Get-Command -Module AKSEdge | Format-Table Name, Version
# check device settings
Install-AksEdgeHostFeatures
# create single machine config
New-AksEdgeConfig -DeploymentType SingleMachineCluster -outFile .\single-config.json | Out-Null
# create AKS EE from config
New-AksEdgeDeployment -JsonConfigFilePath .\single-config.json
# check K8s
kubectl get pods -A
# check network
Get-VMNetworkAdapter -All
Get-VMSwitch
Get-NetIPInterface
# route WSL network to AKS EE network
# you may need to update the interface names
Get-NetIPInterface | where {$_.InterfaceAlias -eq 'vEthernet (WSL)' -or $_.InterfaceAlias -eq 'vEthernet (aksedgesw-int)'} | Set-NetIPInterface -Forwarding Enabled -Verbose
-
Enter your user name and password
- Using the same user name as Windows will make things easier
set USERNAME wsl --install ubuntu
- Once WSL starts, you will be in a bash prompt inside your Ubuntu VM
- You will have to enter you're password the first time you run
sudo
echo "choose Legacy IP Tables"
echo ""
sudo update-alternatives --config iptables
- Set the
root
password to something you can remember - in case you need it
echo ""
echo "set the root password"
sudo passwd
- Your PAT should have access to the GitOps repo Res-Edge uses
Do NOT check your PAT into GitHub!!!
export PAT=MyGitHubPat
- Change the values
git config --global user.name bartr
git config --global user.email [email protected]
git config --global credential.helper store
echo "https://$(git config user.name):$PAT@github.com" > $HOME/.git-credentials
# clone pizza-labs
### some of the WSL changes are only in the bartr branch
cd $HOME
git clone https://github.com/cse-labs/pizza-labs
cd pizza-labs
git checkout bartr
git pull
cp -r .kic ..
cp -r .ds ..
git clone https://github.com/cse-labs/pizza-labs .gitops
cd .gitops
git checkout labs --
git pull
cd $HOME
cd $HOME
git clone https://github.com/bartr/res-edge-wsl wsl
cd wsl
# install tools
sudo ./install.sh
# Configure User
./config.sh
- If you are using this image as a bash shell to manage AKS EE, you have to complete these steps
- This step allows the vSwitches to communicate
- If you used a differnt vSwitch, change before running
- From an elevated PowerShell (on the Windows host) prompt
Get-NetIPInterface | where {$_.InterfaceAlias -eq 'vEthernet (WSL)' -or $_.InterfaceAlias -eq 'vEthernet (aksedgesw-int)'} | Set-NetIPInterface -Forwarding Enabled -Verbose
- From your WSL SSH session
- You may have to update the path
cd $HOME
mkdir -p .kube
# we set KUBECONFIG to $HOME/.kube and /mnt/c/Users/$USER/.kube
# you may have to update paths in $HOME/.zshenv
# cp /mnt/c/Users/$USER/.kube/config .kube
-
exit
the WSL shell -
Restart the WSL shell
wsl -- code ~
-
Use "ctl `" to open a terminal
mkdir -p "$HOME/.oh-my-zsh/completions"
kic completion zsh > "$HOME/.oh-my-zsh/completions/_kic"
ds completion zsh > "$HOME/.oh-my-zsh/completions/_ds"
kubectl completion zsh > "$HOME/.oh-my-zsh/completions/_kubectl"
k3d completion zsh > "$HOME/.oh-my-zsh/completions/_k3d"
kustomize completion zsh > "$HOME/.oh-my-zsh/completions/_kustomize"
gh completion zsh > "$HOME/.oh-my-zsh/completions/_gh"
flux completion zsh > "$HOME/.oh-my-zsh/completions/_flux"
helm completion zsh > "$HOME/.oh-my-zsh/completions/_helm"
compinit
- This will only work if you setup the AKS EE cluster
kic pods
- This will create the k3d cluster
- It will also install Flux and configure as
lab-01
cd $HOME/pizza-labs
kic cluster create
http localhost
http localhost/heartbeat/16
- Using your browser, go to http://localhost and http://localhost/heartbeat/16
- Use https://res-edge.com to deploy / undeploy Namespaces to
/m/type/lab
- Use WSL to save the image for reuse
- Exit WSL into the Command Prompt
- Change to the directory you want to store the file (3 - 8 GB)
# delete the cluster (optional)
wsl -- kic cluster delete
# stop the instance
wsl -t ubuntu
# export the image
wsl --export ubuntu kic.tar
# unregister ubuntu
wsl --unregister ubuntu
# import the image as "kic" - store in ./kic
wsl --import kic kic kic.tar
# start the image
# run kic cluster create if you deleted the cluster
# copy the AKS EE .kube/config file if running as client
wsl -- code ~
wsl -t ubuntu
wsl --unregister ubuntu
This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.