mirror of
https://gitee.com/devstar/devstar-devcontainer-operator
synced 2025-09-16 03:31:07 +00:00
Replaced Nginx Ingress Controller with NodePort Service
This commit is contained in:
@@ -8,8 +8,28 @@ metadata:
|
||||
app.kubernetes.io/managed-by: kustomize
|
||||
spec:
|
||||
statefulset:
|
||||
image: nginx:latest
|
||||
image: mcr.microsoft.com/devcontainers/base:dev-ubuntu-20.04
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- echo 'root:root' | chpasswd && useradd -m -s /bin/bash username && echo 'username:password' | chpasswd && usermod -aG sudo username && apt-get update && apt-get install -y openssh-server && service ssh start && apt-get clean && tail -f /dev/null
|
||||
containerPort: 22
|
||||
service:
|
||||
containerPort: 2222
|
||||
ingress:
|
||||
port: 22
|
||||
servicePort: 22
|
||||
# nodePort: 30000 # 建议动态分配,不建议写入固定 NodePort 值
|
||||
|
||||
|
||||
######################################################################################################################################
|
||||
# 后记:SSH连接方式
|
||||
|
||||
# ```bash
|
||||
# >>>>> minikube ip
|
||||
# # 192.168.49.2
|
||||
#
|
||||
# >>>>> minikube service list
|
||||
# # |-------------------------|----------------------------------------------------------|--------------|---------------------------|
|
||||
# # | NAMESPACE | NAME | TARGET PORT | URL |
|
||||
# # |-------------------------|----------------------------------------------------------|--------------|---------------------------|
|
||||
# # | devstar-devcontainer-ns | daimingchen-devstar-beef092a69c011ef9c00000c2952a362-svc | ssh-port/22 | http://192.168.49.2:32598 |
|
||||
#
|
||||
# >>>>> ssh -p 32598 username@192.168.49.2
|
||||
|
Reference in New Issue
Block a user