-
-
Notifications
You must be signed in to change notification settings - Fork 19
604 lines (507 loc) · 21 KB
/
setup-k8s.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
name: Test k8s
on:
push:
branches:
- master
workflow_dispatch:
defaults:
run:
shell: bash --noprofile --norc -exo pipefail {0}
jobs:
setup-k8s:
# runs-on: ubuntu-${{matrix.dist}}
runs-on: ubuntu-22.04
timeout-minutes: 20
if: |
! contains( github.event.head_commit.message, '[skip ci]')
env:
CI_KUBERNETES_VERSION: ${{matrix.CI_KUBERNETES_VERSION}}
LNMP_K8S_GET: ${{matrix.LNMP_K8S_GET}}
K8S_IMAGE_NS: ${{matrix.K8S_IMAGE_NS}}
K8S_IMAGE_REGISTRY: ${{matrix.K8S_IMAGE_REGISTRY}}
K8S_ROOT: ${{matrix.K8S_ROOT}}
LNMP_K8S_LOCAL_INSTALL_OPTIONS: ${{matrix.LNMP_K8S_LOCAL_INSTALL_OPTIONS}}
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
LNMP_DOCKER_MIRROR: registry-1.docker.io
CNI_CALICO_EBPF: ${{matrix.CNI_CALICO_EBPF}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GENERATE_CLI_HELP: ${{matrix.GENERATE_CLI_HELP}}
IPV6: ${{matrix.IPV6}}
DOWNLOAD_FROM_CODING: "false"
strategy:
max-parallel: 1
matrix:
include:
# next next version
# - os: ubuntu
# dist: 20.04
# CI_KUBERNETES_VERSION: 1.29.0-alpha.1
# LNMP_K8S_GET: --url
# GENERATE_CLI_HELP: "true"
# next version
- os: ubuntu
dist: 20.04
CI_KUBERNETES_VERSION: 1.31.0-alpha.3
LNMP_K8S_GET: --url
GENERATE_CLI_HELP: "true"
# current stable version
- os: ubuntu
dist: 20.04
CI_KUBERNETES_VERSION: 1.30.0
LNMP_K8S_LOCAL_INSTALL_OPTIONS: --crio
K8S_IMAGE_NS: khs1994
K8S_IMAGE_REGISTRY: useccr.ccs.tencentyun.com
UPLOAD_TO_CODING: "true"
- os: ubuntu
dist: 20.04
CI_KUBERNETES_VERSION: 1.30.0
LNMP_K8S_GET: --url
GENERATE_CLI_HELP: "true"
UPLOAD_TO_CODING: "true"
# ipv6
# - os: ubuntu
# dist: 20.04
# CI_KUBERNETES_VERSION: 1.30.0
# LNMP_K8S_GET: --url
# IPV6: "true"
- os: ubuntu
dist: 20.04
CI_KUBERNETES_VERSION: 1.30.0
LNMP_K8S_GET: --url
CNI_CALICO_EBPF: 'true'
# v1.24.0+ not support docker
# - os: ubuntu
# dist: 20.04
# CI_KUBERNETES_VERSION: 1.24.0
# LNMP_K8S_LOCAL_INSTALL_OPTIONS: --docker
- os: ubuntu
dist: 20.04
CI_KUBERNETES_VERSION: 1.30.0
LNMP_K8S_GET: --url
K8S_ROOT: /opt/k8s-custom
# old version
- os: ubuntu
dist: 20.04
CI_KUBERNETES_VERSION: 1.29.6
LNMP_K8S_GET: --url
- os: ubuntu
dist: 20.04
CI_KUBERNETES_VERSION: 1.28.11
LNMP_K8S_GET: --url
- os: ubuntu
dist: 20.04
CI_KUBERNETES_VERSION: 1.27.15
LNMP_K8S_GET: --url
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: docker-practice/actions-setup-docker@master
with:
docker_channel: test
docker_version: "20.10"
- uses: actions/cache@v3
name: k8s-files-caches
with:
path: |
kubernetes-release/release/v${{matrix.CI_KUBERNETES_VERSION}}-linux-amd64/kubernetes/server/bin
key: ${{matrix.CI_KUBERNETES_VERSION}}
- uses: actions/cache@v3
name: khs1994-docker-lnmp-caches
with:
path: ~/.khs1994-docker-lnmp/caches
key: khs1994-docker-lnmp-caches-20201101-0
- run: |
uname -a
docker pull dockerhub.azk8s.cn/library/nginx || true
sudo mount bpffs /sys/fs/bpf -t bpf || true
sudo mount -t bpf || true
df -h
docker image ls
docker system df
docker system prune -a -f
docker system df
sudo apt install -y tree net-tools
sudo update-alternatives --display iptables || true
sudo update-alternatives --list iptables || true
df -h
name: os-metadata
- uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: Setup dns
run: |
pwd
# /home/runner/work/lnmp-k8s/lnmp-k8s
go env
go env GOPATH
go version
sudo go env
sudo go env GOPATH
sudo go version
git clone --depth=1 -b 23.11 https://github.com/khs1994-docker/lnmp ~/lnmp
cp -r ~/lnmp/. /home/runner/work/lnmp-k8s
ls -la /home/runner/work/lnmp-k8s
# remove some apt source
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d || true
sudo rm -rf /etc/apt/sources.list.d/pgdg.list || true
sudo sestatus || true
ls -lat ~/.khs1994-docker-lnmp/caches || true
ls -la kubernetes-release/release/ || true
echo $PATH
docker compose version
docker --version
ip addr
hostnamectl
ifconfig eth0
export SERVER_IP=`ifconfig eth0 | grep "inet" | awk '{ print $2}' | cut -d ':' -f 2`
./lnmp-k8s > /dev/null
echo $SERVER_IP > .server_ip
- run: |
echo is_github_tag_event
if: github.event_name == 'push' && contains(github.ref,'refs/tags/')
name: Is tag event
- name: Install k8s
run: |
SERVER_IP=`cat .server_ip`
export KUBERNETES_TYPE=server
sed -i "s!192.168.199.100!${SERVER_IP}!g" systemd/.env
sed -i "s#/opt/k8s#${K8S_ROOT:-/opt/k8s}#g" systemd/.env
cat systemd/.env
sudo hostnamectl set-hostname node1
echo "${SERVER_IP} node1" | sudo tee -a /etc/hosts
echo "${SERVER_IP} laravel2.t.khs1994.com" | sudo tee -a /etc/hosts
sudo cat /etc/hosts || true
docker compose up cfssl-local
docker compose down
# source .env
ls kubernetes-release/release/v${CI_KUBERNETES_VERSION}-linux-amd64/kubernetes/server/bin/kubectl || rm -rf kubernetes-release/release/v${CI_KUBERNETES_VERSION}-linux-amd64
sudo sed -i "s#^LNMP_CN_ENV=.*#LNMP_CN_ENV=false#g" ./.env
sudo mkdir -p /home/runner/.khs1994-docker-lnmp/dockerhub
sudo chmod -R 777 /home/runner/.khs1994-docker-lnmp
./lnmp-k8s kubernetes-server ${LNMP_K8S_GET}
./lnmp-k8s local-install ${LNMP_K8S_LOCAL_INSTALL_OPTIONS:-}
test "$UPLOAD_TO_CODING" = 'true' && ./lnmp-k8s _crun_install || true
# debug=1 ./lnmp-k8s local-install ${LNMP_K8S_LOCAL_INSTALL_OPTIONS:-}
tree kubernetes-release/release/v${CI_KUBERNETES_VERSION}-linux-amd64/kubernetes
env:
CODING_USERNAME: khs1994-1601432822176
CODING_TOKEN: ${{secrets.CODING_DOCKER_PASSWORD}}
UPLOAD_TO_CODING: ${{matrix.UPLOAD_TO_CODING}}
- name: Start k8s
run: |
export PATH=${K8S_ROOT:-/opt/k8s}/bin:$PATH
ls -lat /etc/systemd/system/
sudo systemctl cat etcd
sudo systemctl start etcd || CMD_FAILED=1
test -n "$CMD_FAILED" && sudo journalctl -u etcd || true
test -n "$CMD_FAILED" && false || true
# master
sudo systemctl cat kube-apiserver
sudo systemctl start kube-apiserver || CMD_FAILED=1
test -n "$CMD_FAILED" && sudo journalctl -u kube-apiserver || true
test -n "$CMD_FAILED" && false || true
sudo systemctl cat kube-controller-manager
sudo systemctl start kube-controller-manager || CMD_FAILED=1
test -n "$CMD_FAILED" && sudo journalctl -u kube-controller-manager || true
test -n "$CMD_FAILED" && false || true
sudo systemctl cat kube-scheduler
# if [ $(echo "${CI_KUBERNETES_VERSION}" | cut -d '.' -f 2) -ge 23 ];then \
# echo "replace kube-scheduler config" \
# && echo "remove it when k8s version ge 1.23" \
# && sudo sed -i -e "s!^healthzBindAddress.*!#healthzBindAddress!g" \
# -e "s!^metricsBindAddress.*!#metricsBindAddress!g" \
# -e "s!v1beta1!v1beta3!g" \
# ${K8S_ROOT:-/opt/k8s}/etc/kubernetes/kube-scheduler.config.yaml ; \
# fi
sudo systemctl start kube-scheduler || CMD_FAILED=1
test -n "$CMD_FAILED" && sudo journalctl -u kube-scheduler || true
test -n "$CMD_FAILED" && false || true
# worker
sudo systemctl cat kube-proxy
if ! [ "$CNI_CALICO_EBPF" = 'true' ];then
sudo systemctl start kube-proxy || CMD_FAILED=1
fi
test -n "$CMD_FAILED" && sudo journalctl -u kube-proxy || true
test -n "$CMD_FAILED" && false || true
sudo systemctl cat docker
sudo systemctl cat cri-containerd@1.7
sudo systemctl cat cri-o || true
sudo cat /etc/sysconfig/crio || true
sudo cat ${K8S_ROOT:-/opt/k8s}/etc/sysconfig/crio || true
/usr/local/bin/crio --config=/etc/crio/crio.conf config > crio.conf || true
/usr/local/bin/crio config --default > crio.default.conf || true
cat crio.conf || true
diff crio.conf crio.default.conf || true
ls -R /etc/crio/crio.conf.d || true
cat /etc/crio/crio.conf.d/00-default.conf || true
echo "!! crio.conf.d 中的文件会覆盖 /etc/crio/crio.conf 中的配置,这里删除 !!" > /dev/null
echo "!! 所有的配置均在 /etc/crio/crio.conf 中进行配置 !!" > /dev/null
sudo rm -rf /etc/crio/crio.conf.d/00-default.conf || true
test -z "${LNMP_K8S_LOCAL_INSTALL_OPTIONS}" \
&& (sudo systemctl daemon-reload ; sudo systemctl start cri-containerd@1.7) || true
test "${LNMP_K8S_LOCAL_INSTALL_OPTIONS}" = "--docker" \
&& (sudo systemctl restart docker || sudo journalctl -u docker) || true
test "${LNMP_K8S_LOCAL_INSTALL_OPTIONS}" = "--crio" \
&& (/usr/local/bin/crio --help; sudo systemctl daemon-reload ; \
sudo systemctl start cri-o) || true
test -z "${LNMP_K8S_LOCAL_INSTALL_OPTIONS}" \
&& export KUBELET_SERVICE='@cri-containerd' || true
test "${LNMP_K8S_LOCAL_INSTALL_OPTIONS}" = "--crio" \
&& export KUBELET_SERVICE='@crio' || true
echo kubelet${KUBELET_SERVICE}
docker info
sleep 10
sudo systemctl cat kubelet${KUBELET_SERVICE}
# github action 硬盘空间不够
sudo sed -i "s/10%/1%/g" ${K8S_ROOT:-/opt/k8s}/etc/kubernetes/kubelet.config.yaml
sudo sed -i "s/5%/1%/g" ${K8S_ROOT:-/opt/k8s}/etc/kubernetes/kubelet.config.yaml
sudo sed -i "s/11%/1%/g" ${K8S_ROOT:-/opt/k8s}/etc/kubernetes/kubelet.config.yaml
cat ${K8S_ROOT:-/opt/k8s}/etc/kubernetes/kubelet.config.yaml
sudo systemctl start kubelet${KUBELET_SERVICE} || CMD_FAILED=1
test -n "$CMD_FAILED" && sudo journalctl -u kubelet${KUBELET_SERVICE} || true
test -n "$CMD_FAILED" && false || true
sleep 10
# sudo systemctl status etcd
# sudo systemctl status docker
# sudo systemctl status kube-apiserver
# sudo systemctl status kube-controller-manager
# sudo systemctl status kube-scheduler
# sudo systemctl status kube-proxy
# sudo systemctl status kubelet${KUBELET_SERVICE}
kubectl version || true
kubectl cluster-info || true
sleep 30
sudo journalctl -u etcd
sudo journalctl -u kube-apiserver
sudo journalctl -u kube-controller-manager
sudo journalctl -u kube-scheduler
sudo journalctl -u kube-proxy
sudo journalctl -u kubelet${KUBELET_SERVICE}
sudo journalctl -u cri-containerd@1.7 || true
sudo journalctl -u cri-o || true
kubectl get csr
CSR_NAME=`kubectl get csr | grep system:node:node1 | awk '{print $1}' | head -1`
echo ${CSR_NAME}
kubectl certificate approve $CSR_NAME
kubectl get csr
sed -i "s#/opt/k8s#${K8S_ROOT:-/opt/k8s}#g" addons/cni/calico-custom/custom.patch.json
if [ "${IPV6}" = 'true' ];then
sed -i -e "s#_IP6#IP6#g" \
-e "s#_FELIX_IPV6SUPPORT#FELIX_IPV6SUPPORT#g" \
addons/cni/calico-custom/custom.patch.json
sed -i 's#assign_ipv6": "false#assign_ipv6": "true#g' \
addons/cni/calico/calico.yaml
fi
git diff
if [ "$CNI_CALICO_EBPF" = 'true' ];then
export SERVER_IP=`cat .server_ip`
cat addons/cni/calico-eBPF/kubernetes.yaml \
| sed -e "s/wsl2.k8s.khs1994.com/${SERVER_IP}/g" \
| kubectl apply -f -
kubectl apply -k addons/cni/calico-eBPF
else
kubectl apply -k addons/cni/calico-custom
fi
kubectl get node
kubectl get all -A
kubectl api-versions
kubectl api-resources
sleep 40
kubectl get all -A
kubectl describe deployment.apps/calico-kube-controllers -n kube-system
kubectl describe pod -n kube-system -l k8s-app=calico-kube-controllers
ip addr
sleep 40
kubectl get all -A
ip addr
# sudo journalctl -u cri-o || true
# if [ "${LNMP_K8S_LOCAL_INSTALL_OPTIONS}" = "--crio" ];then sudo systemctl restart cri-o && sudo systemctl restart kubelet@crio ;fi
sleep 20
kubectl get all -A
kubectl describe deployment.apps/calico-kube-controllers -n kube-system
kubectl describe pod -n kube-system -l k8s-app=calico-kube-controllers
sudo crictl logs $(sudo crictl ps -a --label io.kubernetes.container.name=calico-kube-controllers -q) || true
for id in $(sudo crictl ps -a -q);do sudo crictl logs $id;done || true
- name: Show port
run: |
sudo netstat -nlpt || true
- name: Setup addons
run: |
export PATH=${K8S_ROOT:-/opt/k8s}/bin:$PATH
sudo install -m755 ${K8S_ROOT:-/opt/k8s}/bin/kubectl /usr/local/bin/kubectl
kubectl version --client || true
df -h
ip addr
kubectl apply -k addons/coredns
kubectl apply -k addons/dashboard
kubectl apply -k addons/metrics-server
kubectl apply -k addons/ingress/nginx/nodeport
sleep 100
kubectl get all --all-namespaces
kubectl describe pod metrics-server -n kube-system
# test metrics server
kubectl top node
# test dns
kubectl describe pod coredns -n kube-system
kubectl logs $(kubectl describe pod coredns -n kube-system | grep "Name:" | head -1 | awk '{ print $2}') -n kube-system
kubectl run nginx --image nginx:1.21.0-alpine
sleep 20
kubectl get all
kubectl get pod -o wide
NGINX_POD_NAME=`kubectl get pod | awk '{print $1}' | tail -1`
sudo crictl pull nginx:1.21.0-alpine || true
# sudo journalctl -u cri-o || true
kubectl exec ${NGINX_POD_NAME} -- cat /etc/resolv.conf
kubectl exec ${NGINX_POD_NAME} -- ping -c 5 kubernetes || kubectl exec ${NGINX_POD_NAME} -- nslookup kubernetes || true
kubectl exec ${NGINX_POD_NAME} -- ping -c 5 github.com || kubectl exec ${NGINX_POD_NAME} -- nslookup github.com
kubectl exec ${NGINX_POD_NAME} -- curl -k https://kubernetes/api || true
kubectl expose pod/${NGINX_POD_NAME} --port=80
sleep 2
NGINX_SERVICE_NAME=$(echo $(kubectl get svc | grep nginx | awk '{ print $1 }' | cut -d "/" -f 2))
echo $NGINX_SERVICE_NAME
echo $NGINX_POD_NAME
kubectl get all
kubectl exec ${NGINX_POD_NAME} -- curl $NGINX_SERVICE_NAME || true
kubectl delete svc/${NGINX_SERVICE_NAME}
# ipv6
if [ "${IPV6}" = 'true' ];then
kubectl apply -f demo/ipv6
kubectl get svc/nginx -o yaml
kubectl get deployment/nginx -o yaml || true
kubectl get pod/${NGINX_POD_NAME} -o yaml
set -x
POD_IPV4_IP=`kubectl get pod/${NGINX_POD_NAME} -o go-template="{{(index .status.podIPs 0).ip}}"`
curl ${POD_IPV4_IP}:80 || true
POD_IPV6_IP=`kubectl get pod/${NGINX_POD_NAME} -o go-template="{{(index .status.podIPs 1).ip}}"` || true
curl [${POD_IPV6_IP}]:80 || true
CLUSTER_IPV6_IP=`kubectl get svc/nginx -o go-template="{{ .spec.clusterIP }}"`
curl [${CLUSTER_IPV6_IP}]:80 || true
NODE_IPV6_IP=`ifconfig eth0 | grep "inet6" | awk '{ print $2}' | head -1`
curl [${NODE_IPV6_IP}]:8080 || true
fi
kubectl delete deployment nginx || true
kubectl delete pod ${NGINX_POD_NAME} || true
kubectl delete svc/${NGINX_SERVICE_NAME} || true
kubectl get all
# test ingress-nginx
HTTP_PORT=`kubectl get service -n ingress-nginx | grep ingress-nginx | grep NodePort | awk '{print $5}' | cut -d ':' -f 2 | cut -d / -f 1`
curl --version
SERVER_IP=`cat .server_ip`
curl ${SERVER_IP}:${HTTP_PORT}
# test "${LNMP_K8S_GET}" = "--url" && sudo rm -rf kubernetes-release/release/ || true
- name: cleanup
run: |
df -h
sudo rm -rf ${K8S_ROOT:-/opt/k8s}/bin/apiextensions-apiserver
sudo rm -rf ${K8S_ROOT:-/opt/k8s}/bin/kubeadm
df -h
- name: Test k8s
run: |
export PATH=${K8S_ROOT:-/opt/k8s}/bin:$PATH
export SERVER_IP=`cat .server_ip`
sudo crictl version
echo ::group::crictl info
sudo crictl info
echo ::endgroup::
ip addr
echo ::group::git diff
git diff
echo ::endgroup::
# cd cli ; (sh generate.sh || true); cd ..
# git diff
sudo netstat -lnpt
echo ::group::Test k8s
./tests/test.sh
echo ::endgroup::
sudo crictl version
echo ::group::crictl info
sudo crictl info
echo ::endgroup::
sudo ls -lat /opt || true
sudo ls -lat /opt/k8s || true
sudo ls -lat ${K8S_ROOT:-/opt/k8s} || true
echo ::group::kubectl get node
kubectl get node -o yaml
echo ::endgroup::
- name: Config git
run: |
git config --global user.email "gh-bot@khs1994.com"
git config --global user.name "gh-bot"
- name: Update k8s cli help info
run:
|
export PATH=${K8S_ROOT:-/opt/k8s}/bin:$PATH
BASE_BRANCH=master
# BASE_BRANCH=v1.25.0-config
if ! [ $CI_KUBERNETES_VERSION = '1.30.0' -a "$GENERATE_CLI_HELP" = "true" ];then
exit 0
fi
set -x
cd /tmp
git clone -b ${BASE_BRANCH} --depth=3 https://khs1994:${GITHUB_TOKEN}@github.com/khs1994-docker/lnmp-k8s
cd lnmp-k8s
stty size || true
stty cols 200 || true
# sudo sed -i "s#^LNMP_CN_ENV=.*#LNMP_CN_ENV=true#g" ./.env
cd cli ; (COLUMNS=200 sh generate.sh || true); cd ..
git add .
git commit -m "Update v$CI_KUBERNETES_VERSION config" -s \
&& git push origin $(git branch --show-current):v$CI_KUBERNETES_VERSION-config -f \
|| true
cd /tmp
rm -rf lnmp-k8s
- name: Update k8s next cli help info
run:
|
export PATH=${K8S_ROOT:-/opt/k8s}/bin:$PATH
BASE_BRANCH=v1.29.0-alpha.1-config
BASE_BRANCH=master
# BASE_BRANCH=v1.28.0-config
if [ $CI_KUBERNETES_VERSION != '1.31.0-alpha.3' ];then
exit 0
fi
set -x
cd /tmp
rm -rf lnmp-k8s
git clone -b ${BASE_BRANCH} --depth=3 https://khs1994:${GITHUB_TOKEN}@github.com/khs1994-docker/lnmp-k8s \
|| git clone -b master --depth=3 https://khs1994:${GITHUB_TOKEN}@github.com/khs1994-docker/lnmp-k8s
cd lnmp-k8s
stty size || true
stty cols 200 || true
# sudo sed -i "s#^LNMP_CN_ENV=.*#LNMP_CN_ENV=true#g" ./.env
cd cli ; (COLUMNS=200 sh generate.sh || true); cd ..
git add .
git commit -m "Update v$CI_KUBERNETES_VERSION config" -s \
&& git push origin $(git branch --show-current):v${CI_KUBERNETES_VERSION}-config -f \
|| true
- name: Update k8s next next cli help info
run:
|
export PATH=${K8S_ROOT:-/opt/k8s}/bin:$PATH
BASE_BRANCH=v1.28.0-alpha.1
BASE_BRANCH=master
if [ $CI_KUBERNETES_VERSION != 'x.y.z-alpha.1' ];then
exit 0
fi
set -x
cd /tmp
rm -rf lnmp-k8s
git clone -b ${BASE_BRANCH} --depth=3 https://khs1994:${GITHUB_TOKEN}@github.com/khs1994-docker/lnmp-k8s \
|| git clone -b master --depth=3 https://khs1994:${GITHUB_TOKEN}@github.com/khs1994-docker/lnmp-k8s
cd lnmp-k8s
stty size || true
stty cols 200 || true
# sudo sed -i "s#^LNMP_CN_ENV=.*#LNMP_CN_ENV=true#g" ./.env
cd cli ; (COLUMNS=200 sh generate.sh || true); cd ..
git add .
git commit -m "Update v$CI_KUBERNETES_VERSION config" -s \
&& git push origin $(git branch --show-current):v${CI_KUBERNETES_VERSION}-config -f \
|| true
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: ${{ failure() }}
# timeout-minutes: 60