Skip to content

Commit

Permalink
Merge main.
Browse files Browse the repository at this point in the history
Signed-off-by: huaiyou <[email protected]>
  • Loading branch information
VinceCui committed Dec 27, 2022
2 parents 0e33e52 + e3c5ccb commit d3fd66e
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ACK Distro, as a downstream of ACK, will keep up-to-date with ACK's release. ACK

```bash
ARCH=amd64 # or arm64
wget https://ack-a-aecp.oss-cn-hangzhou.aliyuncs.com/ack-distro/bin/${ARCH}/sealer-latest-linux-${ARCH}.tar.gz -O sealer-latest-linux-${ARCH}.tar.gz && \
wget https://github.com/sealerio/sealer/releases/download/v0.9.0/sealer-v0.9.0-linux-amd64.tar.gz -O sealer-latest-linux-${ARCH}.tar.gz && \
tar -xvf sealer-latest-linux-${ARCH}.tar.gz -C /usr/bin

sealer run ack-agility-registry.cn-shanghai.cr.aliyuncs.com/ecp_builder/ackdistro:v1-22-3-ack-3 -m ${master_ip1}[,${master_ip2},${master_ip3}] [ -n ${worker_ip1}...] -p password
Expand Down
2 changes: 1 addition & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ACK Distro作为ACK的下游,会紧跟ACK的发版节奏,具体发版策略

```shell
ARCH=amd64 # or arm64
wget https://ack-a-aecp.oss-cn-hangzhou.aliyuncs.com/ack-distro/bin/${ARCH}/sealer-latest-linux-${ARCH}.tar.gz -O sealer-latest-linux-${ARCH}.tar.gz && \
wget https://github.com/sealerio/sealer/releases/download/v0.9.0/sealer-v0.9.0-linux-amd64.tar.gz -O sealer-latest-linux-${ARCH}.tar.gz && \
tar -xvf sealer-latest-linux-${ARCH}.tar.gz -C /usr/bin

sealer run ack-agility-registry.cn-shanghai.cr.aliyuncs.com/ecp_builder/ackdistro:v1-22-3-ack-3 -m ${master_ip1}[,${master_ip2},${master_ip3}] [ -n ${worker_ip1}...] -p password
Expand Down
28 changes: 26 additions & 2 deletions build/plugins/pre_init_host_shell_plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
type: SHELL
action: pre-init-host
scope: master | node
scope: node
data: |
set -x
export HostIPFamily=${HostIPFamily:-4}
Expand All @@ -15,4 +15,28 @@ spec:
bash scripts/pre_init_host.sh
if [ $? -ne 0 ];then
exit 1
fi
fi
---
apiVersion: sealer.aliyun.com/v1alpha1
kind: Plugin
metadata:
name: pre_init_host_master # Specify this plugin name,will dump in $rootfs/plugin dir.
spec:
type: SHELL
action: pre-init-host
scope: master
data: |
set -x
export HostIPFamily=${HostIPFamily:-4}
export HostIP=${HostIP}
export IPv6DualStack=${IPv6DualStack:-true}
bash scripts/pre_init_host.sh
if [ $? -ne 0 ];then
exit 1
fi
cp -f scripts/push-to-registry.sh /usr/local/bin/push-to-registry.sh
chmod +x /usr/local/bin/push-to-registry.sh
cp -f scripts/etcdctl_v3.sh /usr/local/bin/etcdctl_v3
chmod +x /usr/local/bin/etcdctl_v3
1 change: 1 addition & 0 deletions build/scripts/etcdctl_v3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key $@
46 changes: 46 additions & 0 deletions build/scripts/push-to-registry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#! /bin/bash

set -e

if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
echo "此脚本的入参为一个本地存在的docker镜像的tar包路径或者一个本地存在的docker镜像名"
echo "此脚本会将传入的镜像tar包或者镜像名,转存到sealer registry当中"
echo "Usage: $0 /root/image.tar #这是一个docker镜像save的tar包"
echo " $0 image.tgz #这是对一个docker镜像save的tar包进行gzip压缩的包"
echo " $0 nginx:latest #这是一个docker镜像名称"
exit 0
fi

split_image_name() {
ImageUrl=$1
res="${ImageUrl//[^\/]}"
PartNum=${#res}
if [ ${PartNum} -eq 2 ];then
Domain=$(echo $ImageUrl | cut -d'/' -f 2)
Image=$(echo $ImageUrl | cut -d'/' -f 3)
elif [ ${PartNum} -eq 1 ];then
Domain=default
Image=$(echo $ImageUrl | cut -d'/' -f 2)
elif [ ${PartNum} -eq 0 ];then
Domain=default
Image=$ImageUrl
fi
}

if echo "$1" | grep -q -E '\.tar$';then
FullName=`docker load -i ${1} | cut -d' ' -f 3`
elif echo "$1" | grep -q -E '\.tgz$';then
image=`tar -xvf $1`
FullName=`docker load -i ${image} | cut -d' ' -f 3`
else
FullName="$1"
fi

split_image_name $FullName

for m in `kubectl get no -owide |grep master|awk '{print $6}'`;do
docker tag $ImageUrl ${m}:5000/$Domain/$Image
docker push ${m}:5000/$Domain/$Image
done

echo "已成功转存到 registry-internal.adp.aliyuncs.com:5000/$Domain/$Image"
2 changes: 1 addition & 1 deletion docs/user-guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Get sealer:

```bash
ARCH=amd64 # or arm64
wget https://ack-a-aecp.oss-cn-hangzhou.aliyuncs.com/ack-distro/bin/${ARCH}/sealer-latest-linux-${ARCH}.tar.gz -O sealer-latest-linux-${ARCH}.tar.gz && \
wget https://github.com/sealerio/sealer/releases/download/v0.9.0/sealer-v0.9.0-linux-amd64.tar.gz -O sealer-latest-linux-${ARCH}.tar.gz && \
tar -xvf sealer-latest-linux-${ARCH}.tar.gz -C /usr/bin
```

Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/getting-started_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

```bash
ARCH=amd64 # or arm64
wget https://ack-a-aecp.oss-cn-hangzhou.aliyuncs.com/ack-distro/bin/${ARCH}/sealer-latest-linux-${ARCH}.tar.gz -O sealer-latest-linux-${ARCH}.tar.gz && \
wget https://github.com/sealerio/sealer/releases/download/v0.9.0/sealer-v0.9.0-linux-amd64.tar.gz -O sealer-latest-linux-${ARCH}.tar.gz && \
tar -xvf sealer-latest-linux-${ARCH}.tar.gz -C /usr/bin
```

Expand Down
1 change: 0 additions & 1 deletion docs/user-guide/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ To successfully install ACK Distro, you need to ensure that the following requir

### Kernel:

- 4.18.*
- 4.19.*
- 3.10.* (must >=3.10.0-1160)

Expand Down
1 change: 0 additions & 1 deletion docs/user-guide/requirements_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

### Kernel:

- 4.18.*
- 4.19.*
- 3.10.* (must >=3.10.0-1160)

Expand Down

0 comments on commit d3fd66e

Please sign in to comment.