Skip to content

Commit

Permalink
Fix k9s install
Browse files Browse the repository at this point in the history
  • Loading branch information
jlian authored Nov 7, 2023
1 parent 495ae6e commit 8bda645
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 42 deletions.
8 changes: 7 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ RUN wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh
# Install mqttui
RUN wget https://github.com/EdJoPaTo/mqttui/releases/download/v0.19.0/mqttui-v0.19.0-x86_64-unknown-linux-gnu.deb && \
sudo apt-get install ./mqttui-v0.19.0-x86_64-unknown-linux-gnu.deb && \
rm -rf ./mqttui-v0.19.0-x86_64-unknown-linux-gnu.deb
rm -rf ./mqttui-v0.19.0-x86_64-unknown-linux-gnu.deb

# Install k9s
RUN wget https://github.com/derailed/k9s/releases/download/v0.28.0/k9s_Linux_amd64.tar.gz && \
tar xf k9s_Linux_amd64.tar.gz --directory=/usr/local/bin k9s && \
chmod +x /usr/local/bin/k9s && \
rm -rf k9s_Linux_amd64.tar.gz
76 changes: 36 additions & 40 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,43 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm-minikube
{
"name": "Kubernetes - k3d",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/universal:2-linux",
"build": {
"dockerfile": "Dockerfile"
},
"hostRequirements": {
"cpus": 4,
"memory": "8gb",
"storage": "32gb"
"name": "Kubernetes - k3d",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/universal:2-linux",
"build": {
"dockerfile": "Dockerfile"
},
"hostRequirements": {
"cpus": 4,
"memory": "8gb",
"storage": "32gb"
},
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {
"extensions": "connectedk8s,k8s-extension"
},
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {
"extensions": "connectedk8s,k8s-extension"
},
"ghcr.io/rio/features/k3d:1": {},
"ghcr.io/rio/features/k9s:1": {}
"ghcr.io/rio/features/k3d:1": {}
},
"secrets": {
"SUBSCRIPTION_ID": {
"description": "Your Azure subscription ID"
},
"secrets": {
"SUBSCRIPTION_ID": {
"description": "Your Azure subscription ID"
},
"RESOURCE_GROUP": {
"description": "Your Azure resource group"
},
"REGION": {
"description": "Region to use, must be one of eastus, eastus2, westus, westus2, westus3, westeurope, or northeurope.",
"documentationUrl": "https://review.learn.microsoft.com/en-us/azure/iot-operations/deploy/howto-prepare-cluster"
}
"RESOURCE_GROUP": {
"description": "Your Azure resource group"
},
"containerEnv": {
"CLUSTER_NAME": "${localEnv:CODESPACE_NAME}"
"REGION": {
"description": "Region to use, must be one of eastus, eastus2, westus, westus2, westus3, westeurope, or northeurope.",
"documentationUrl": "https://review.learn.microsoft.com/en-us/azure/iot-operations/deploy/howto-prepare-cluster"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh"
// Use 'postStartCommand' to run commands after the container is created like starting minikube.
// "postStartCommand": "nohup bash -c 'minikube start &' > minikube.log 2>&1",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh"
// Use 'postStartCommand' to run commands after the container is created like starting minikube.
// "postStartCommand": "nohup bash -c 'minikube start &' > minikube.log 2>&1",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
2 changes: 1 addition & 1 deletion .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export K3D_FIX_MOUNTS=1

# Create k3d cluster with NFS support and forwarded ports
# See https://github.com/jlian/k3d-nfs
k3d cluster create $CLUSTER_NAME -i ghcr.io/jlian/k3d-nfs:v1.25.3-k3s1 \
k3d cluster create -i ghcr.io/jlian/k3d-nfs:v1.25.3-k3s1 \
-p '1883:1883@loadbalancer' \
-p '8883:8883@loadbalancer' \
-p '6001:6001@loadbalancer' \
Expand Down

0 comments on commit 8bda645

Please sign in to comment.