diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs | 52 |
1 files changed, 22 insertions, 30 deletions
| @@ -1,48 +1,40 @@ | |||
| 1 | # Rocky SSH Container | 1 | # Rocky SSH Container |
| 2 | Rocky Linux development environment with SSH access for Podman and Kubernetes. | ||
| 3 | 2 | ||
| 4 | ## Launcher Commands | 3 | ## Podman |
| 5 | ```bash | 4 | ```bash |
| 6 | # Check image status and show build commands | 5 | python3 podman_launch_devenv.py |
| 7 | python3 launcher.py | 6 | python3 podman_launch_devenv.py run |
| 8 | python3 launcher.py run | 7 | python3 podman_launch_devenv.py run -p 2222 |
| 9 | python3 launcher.py run -p 2222 | 8 | python3 podman_launch_devenv.py list |
| 10 | python3 launcher.py list | 9 | python3 podman_launch_devenv.py cleanup |
| 11 | python3 launcher.py cleanup | ||
| 12 | ``` | 10 | ``` |
| 13 | 11 | ||
| 14 | ## Kubernetes Commands | 12 | ## Kubernetes |
| 15 | ```bash | 13 | ```bash |
| 16 | kubectl apply -f rocky-ssh-deployment.yaml | 14 | kubectl apply -f rocky-ssh-deployment.yaml |
| 17 | # Check pods with IPs | 15 | kubectl get pods -l app=rocky-dev -o wide |
| 18 | kubectl get pods -l app=rocky-dev-deploy -o wide | 16 | kubectl get svc rocky-dev-svc |
| 19 | # Check services (networking), get deployment is for stateless (not this) | 17 | kubectl delete pod rocky-dev-0 |
| 20 | kubectl get svc rocky-dev-deploy-svc | 18 | kubectl scale statefulset rocky-dev --replicas=10 |
| 21 | # Delete specific pod (auto-recreates) | ||
| 22 | kubectl delete pod rocky-dev-deploy-0 | ||
| 23 | # Scale replicas | ||
| 24 | kubectl scale statefulset rocky-dev-deploy --replicas=10 | ||
| 25 | kubectl delete -f rocky-ssh-deployment.yaml | 19 | kubectl delete -f rocky-ssh-deployment.yaml |
| 26 | ``` | 20 | ``` |
| 27 | 21 | ||
| 28 | ## Local Registry (for Kubernetes) | 22 | ## Local Registry |
| 29 | ```bash | 23 | ```bash |
| 30 | # Run a local registry | ||
| 31 | podman run -d -p 5000:5000 --name registry registry:2 | 24 | podman run -d -p 5000:5000 --name registry registry:2 |
| 32 | # Tag and push to local registry | ||
| 33 | podman tag localhost/rocky_dev:latest localhost:5000/rocky_dev:latest | 25 | podman tag localhost/rocky_dev:latest localhost:5000/rocky_dev:latest |
| 34 | podman push localhost:5000/rocky_dev:latest --tls-verify=false | 26 | podman push localhost:5000/rocky_dev:latest --tls-verify=false |
| 35 | # Update image in rocky-ssh-deployment.yaml to: localhost:5000/rocky_dev:latest | ||
| 36 | ``` | 27 | ``` |
| 37 | 28 | ||
| 38 | ## SSH Access | 29 | ## Access |
| 39 | ```bash | 30 | ```bash |
| 40 | # Podman (launcher shows connection command) | 31 | # Direct shell |
| 41 | ssh root@<host> -p <port> | 32 | kubectl exec -it rocky-dev-0 -- /bin/bash |
| 42 | # Kubernetes (port forward - localhost only) | 33 | |
| 43 | kubectl port-forward <pod-name> 2222:22 | 34 | # SSH with agent forwarding (2 terminals) |
| 44 | ssh root@localhost -p 2222 | 35 | kubectl port-forward rocky-dev-0 2222:22 |
| 45 | # Kubernetes (port forward - external access) | 36 | ssh-agent bash -c 'ssh-add ~/macm4-resident && ssh -A -p 2222 root@localhost' |
| 46 | kubectl port-forward --address 0.0.0.0 <pod-name> 9999:22 | 37 | |
| 47 | ssh root@<host> -p 9999 | 38 | # External |
| 39 | kubectl port-forward --address 0.0.0.0 rocky-dev-0 9999:22 | ||
| 48 | ``` | 40 | ``` |
