devstar-devcontainer-operator/config/samples/devcontainer_v1_devcontainerapp.yaml
Mingchen Dai 7aa665a314
优化 DevcontainerApp Reconciler 逻辑:
- 将 NodePort 调度结果放在 app.Status 域,避免修改 Spec 导致 NodePort Service 重复创建
- 将 namespace 修改成 devstar-studio-ns,防止后期整合 RBAC 遇到问题
- 增加 label devstar-resource-type=devstar-devcontainer
2024-09-25 01:44:56 +00:00

36 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

apiVersion: devcontainer.devstar.cn/v1
kind: DevcontainerApp
metadata:
name: daimingchen-devstar-beef092a69c011ef9c00000c2952a362
namespace: devstar-studio-ns
labels:
app.kubernetes.io/name: devstar-devcontainer-kubebuilder-scaffold
app.kubernetes.io/managed-by: kustomize
spec:
statefulset:
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:
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