创建于2024-03-25更新于 2025-03-22
导入 yaml 文件
注意调整 namespace
###
# 批量替换 namespace: scrm
###
# ServiceAccount
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: tailscale
namespace: scrm
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tailscale
namespace: scrm
subjects:
- kind: ServiceAccount
name: tailscale
roleRef:
kind: Role
name: tailscale
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: tailscale
namespace: scrm
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["secrets"]
# Create can not be restricted to a resource name.
verbs: ["create"]
- apiGroups: [""] # "" indicates the core API group
resourceNames: ["tailscale-auth"]
resources: ["secrets"]
verbs: ["get", "update", "patch"]
# 部署
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
k8s.kuboard.cn/displayName: tailscale
labels:
k8s.kuboard.cn/layer: web
k8s.kuboard.cn/name: dev-tail
name: dev-tail
namespace: scrm
resourceVersion: '20737565389'
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s.kuboard.cn/layer: web
k8s.kuboard.cn/name: dev-tail
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
annotations:
kubectl.kubernetes.io/restartedAt: '2024-05-06T00:06:49+08:00'
creationTimestamp: null
labels:
k8s.kuboard.cn/layer: web
k8s.kuboard.cn/name: dev-tail
spec:
containers:
- env:
- name: TS_AUTHKEY
value: tskey-auth-kTwQRqR7yu11CNTRL-vo3dDsb8ZESs5F58XjJiAS22V6x8tkcVc
- name: TS_USERSPACE
value: 'false'
- name: TS_KUBE_SECRET
value: tailscale-auth
- name: TS_HOSTNAME
value: aoxmed-tail
- name: TS_EXTRA_ARGS
value: '--ssh'
image: 'registry-vpc.cn-shanghai.aliyuncs.com/base-widiazine/base:tailscale_2.0'
imagePullPolicy: Always
name: ts-sidecar
resources:
limits:
cpu: '2'
memory: 4Gi
requests:
cpu: 100m
memory: 256Mi
securityContext:
capabilities:
add:
- NET_ADMIN
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /root
name: volume-sj42e
subPath: idea
- image: 'registry-vpc.cn-shanghai.aliyuncs.com/base-widiazine/base:vscode'
imagePullPolicy: IfNotPresent
name: vscode
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: aliyun
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: tailscale
serviceAccountName: tailscale
terminationGracePeriodSeconds: 30
volumes:
- name: volume-sj42e
persistentVolumeClaim:
claimName: idea-data
# 存储挂载
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
k8s.kuboard.cn/pvcType: Dynamic
pv.kubernetes.io/bind-completed: 'yes'
pv.kubernetes.io/bound-by-controller: 'yes'
finalizers:
- kubernetes.io/pvc-protection
name: idea-data
namespace: scrm
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
storageClassName: default # 存储类型
进入容器
创建 GIT 目录
cd /root/GIT/
git 拉取
git clone https://xxx
输入一次,以后记住
git config --global credential.helper store打开 gateway,准备创建
注意调整 Maven 配置文件
注意下载 JDK
页面信息›
已优化否