Skip to content

Commit

Permalink
docs(devcontainer): Generate documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
TAM360 committed Aug 14, 2024
1 parent e4355d2 commit 8ebac64
Show file tree
Hide file tree
Showing 21 changed files with 525 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Build the manager binary
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon):
# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster
ARG TAG=1.22
FROM golang:${TAG}

COPY post-install.sh .

# Install dependencies
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

RUN go install sigs.k8s.io/[email protected] && \
curl -o kubebuilder \
-L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \
chmod +x kubebuilder && \
mv kubebuilder /usr/local/bin/ && \
chmod +x post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker
{
"name": "Kubebuilder DevContainer",
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.11.0": {
"moby": true,
"azureDnsAutoDetection": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": false,
"upgradePackages": true,
"username": "devcontainer",
"userUid": "1001",
"userGid": "1001"
},
"ghcr.io/devcontainers/features/git:1": {
"ppa": true,
"version": "system"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.22.0"
}
},

"runArgs": ["--network=host"],
// "forwardPorts": [],

"postCreateCommand": "bash ./.devcontainer/post-install.sh"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

go version
kubectl version --client

# Check if Kind cluster already exists.
if kubectl cluster-info &>/dev/null; then
echo "Kind cluster already exists."
else
echo "Kind cluster doesn't exist. Creating new cluster...."
kind create cluster
fi

kubectl get nodes -o wide
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Build the manager binary
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon):
# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster
ARG TAG=1.22
FROM golang:${TAG}

COPY post-install.sh .

# Install dependencies
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

RUN go install sigs.k8s.io/[email protected] && \
curl -o kubebuilder \
-L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \
chmod +x kubebuilder && \
mv kubebuilder /usr/local/bin/ && \
chmod +x post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker
{
"name": "Kubebuilder DevContainer",
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.11.0": {
"moby": true,
"azureDnsAutoDetection": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": false,
"upgradePackages": true,
"username": "devcontainer",
"userUid": "1001",
"userGid": "1001"
},
"ghcr.io/devcontainers/features/git:1": {
"ppa": true,
"version": "system"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.22.0"
}
},

"runArgs": ["--network=host"],
// "forwardPorts": [],

"postCreateCommand": "bash ./.devcontainer/post-install.sh"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

go version
kubectl version --client

# Check if Kind cluster already exists.
if kubectl cluster-info &>/dev/null; then
echo "Kind cluster already exists."
else
echo "Kind cluster doesn't exist. Creating new cluster...."
kind create cluster
fi

kubectl get nodes -o wide
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Build the manager binary
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon):
# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster
ARG TAG=1.22
FROM golang:${TAG}

COPY post-install.sh .

# Install dependencies
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

RUN go install sigs.k8s.io/[email protected] && \
curl -o kubebuilder \
-L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \
chmod +x kubebuilder && \
mv kubebuilder /usr/local/bin/ && \
chmod +x post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker
{
"name": "Kubebuilder DevContainer",
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.11.0": {
"moby": true,
"azureDnsAutoDetection": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": false,
"upgradePackages": true,
"username": "devcontainer",
"userUid": "1001",
"userGid": "1001"
},
"ghcr.io/devcontainers/features/git:1": {
"ppa": true,
"version": "system"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.22.0"
}
},

"runArgs": ["--network=host"],
// "forwardPorts": [],

"postCreateCommand": "bash ./.devcontainer/post-install.sh"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

go version
kubectl version --client

# Check if Kind cluster already exists.
if kubectl cluster-info &>/dev/null; then
echo "Kind cluster already exists."
else
echo "Kind cluster doesn't exist. Creating new cluster...."
kind create cluster
fi

kubectl get nodes -o wide
18 changes: 18 additions & 0 deletions testdata/project-v4-multigroup/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Build the manager binary
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon):
# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster
ARG TAG=1.22
FROM golang:${TAG}

COPY post-install.sh .

# Install dependencies
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

RUN go install sigs.k8s.io/[email protected] && \
curl -o kubebuilder \
-L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \
chmod +x kubebuilder && \
mv kubebuilder /usr/local/bin/ && \
chmod +x post-install.sh
42 changes: 42 additions & 0 deletions testdata/project-v4-multigroup/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker
{
"name": "Kubebuilder DevContainer",
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.11.0": {
"moby": true,
"azureDnsAutoDetection": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": false,
"upgradePackages": true,
"username": "devcontainer",
"userUid": "1001",
"userGid": "1001"
},
"ghcr.io/devcontainers/features/git:1": {
"ppa": true,
"version": "system"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.22.0"
}
},

"runArgs": ["--network=host"],
// "forwardPorts": [],

"postCreateCommand": "bash ./.devcontainer/post-install.sh"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
15 changes: 15 additions & 0 deletions testdata/project-v4-multigroup/.devcontainer/post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

go version
kubectl version --client

# Check if Kind cluster already exists.
if kubectl cluster-info &>/dev/null; then
echo "Kind cluster already exists."
else
echo "Kind cluster doesn't exist. Creating new cluster...."
kind create cluster
fi

kubectl get nodes -o wide
18 changes: 18 additions & 0 deletions testdata/project-v4-with-deploy-image/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Build the manager binary
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon):
# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster
ARG TAG=1.22
FROM golang:${TAG}

COPY post-install.sh .

# Install dependencies
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

RUN go install sigs.k8s.io/[email protected] && \
curl -o kubebuilder \
-L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \
chmod +x kubebuilder && \
mv kubebuilder /usr/local/bin/ && \
chmod +x post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker
{
"name": "Kubebuilder DevContainer",
"build": {
"dockerfile": "./Dockerfile",
"context": "."
},

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.11.0": {
"moby": true,
"azureDnsAutoDetection": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": false,
"upgradePackages": true,
"username": "devcontainer",
"userUid": "1001",
"userGid": "1001"
},
"ghcr.io/devcontainers/features/git:1": {
"ppa": true,
"version": "system"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.22.0"
}
},

"runArgs": ["--network=host"],
// "forwardPorts": [],

"postCreateCommand": "bash ./.devcontainer/post-install.sh"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

go version
kubectl version --client

# Check if Kind cluster already exists.
if kubectl cluster-info &>/dev/null; then
echo "Kind cluster already exists."
else
echo "Kind cluster doesn't exist. Creating new cluster...."
kind create cluster
fi

kubectl get nodes -o wide
Loading

0 comments on commit 8ebac64

Please sign in to comment.