Added information about using debug cotnainer
This commit is contained in:
@@ -37,6 +37,26 @@ deb-src [signed-by=/etc/apt/keyrings/opentofu.gpg,/etc/apt/keyrings/opentofu-rep
|
||||
sudo apt install tofu
|
||||
```
|
||||
|
||||
## Important tasks
|
||||
|
||||
### Reuse machine secrets
|
||||
|
||||
```shell
|
||||
tofu state rm module.talos.talos_machine_secrets.this
|
||||
tofu import module.talos.talos_machine_secrets.this output/talos-machine-secrets.yaml
|
||||
tofu apply --refresh=false
|
||||
```
|
||||
|
||||
### Run interactive container
|
||||
|
||||
```shell
|
||||
kubectl run -i --tty --rm debug --image=harbor.prod.eis-mk8.de.s5b.org/internal/debug-container:latest --restart=Never -- sh
|
||||
```
|
||||
|
||||
If the container is not automatically removed, use
|
||||
```shell
|
||||
kubectl delete pod debug
|
||||
```
|
||||
|
||||
|
||||
## Literature
|
||||
|
||||
22
90-debugging/00-dev_container/Dockerfile
Normal file
22
90-debugging/00-dev_container/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM harbor.prod.eis-mk8.de.s5b.org/proxy-mcr.microsoft.com/devcontainers/base:trixie
|
||||
|
||||
ARG USERNAME=vscode
|
||||
|
||||
# Default powerline10k theme, no plugins installed
|
||||
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.1/zsh-in-docker.sh)"
|
||||
|
||||
# Install important packages
|
||||
RUN apt-get update && apt-get -y install mtr-tiny iproute2 whois tcpdump vim
|
||||
|
||||
# Used to persist bash history as per https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history
|
||||
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
|
||||
&& mkdir /commandhistory \
|
||||
&& touch /commandhistory/.bash_history \
|
||||
&& chown -R $USERNAME /commandhistory \
|
||||
&& echo "$SNIPPET" >> "/home/$USERNAME/.bashrc"
|
||||
|
||||
# install jless (because its not available at https://containers.dev/features at time of writing)
|
||||
# RUN NONINTERACTIVE=1 /usr/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" \
|
||||
# && (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/vscode/.profile \
|
||||
# && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \
|
||||
# && brew install jless
|
||||
5
90-debugging/00-dev_container/build.sh
Executable file
5
90-debugging/00-dev_container/build.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
docker build -t harbor.prod.eis-mk8.de.s5b.org/internal/debug-container:latest .
|
||||
|
||||
docker push harbor.prod.eis-mk8.de.s5b.org/internal/debug-container:latest
|
||||
Reference in New Issue
Block a user