Skip to content

Commit

Permalink
Merge branch 'tkestack:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
GaoXiaodong committed Aug 3, 2021
2 parents f16e682 + cb69ab7 commit 4da8f4b
Show file tree
Hide file tree
Showing 38 changed files with 559 additions and 327 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ release.build:
ifeq ($(NEED_BUILD_PROVIDER),true)
cd build/docker/tools/provider-res && make all
endif
make push.multiarch
make manifest.multiarch

## release: Release tke
.PHONY: release
Expand Down
27 changes: 15 additions & 12 deletions api/application/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ type AppList struct {

// AppSpec is a description of a bootstrap.
type AppSpec struct {
Type AppType
TenantID string
Name string
TargetCluster string
Type AppType
TenantID string
Name string
TargetCluster string
TargetNamespace string
// +optional
Chart Chart
// Values holds the values for this app.
Expand Down Expand Up @@ -137,10 +138,11 @@ type AppHistory struct {

// AppHistorySpec is a description of a AppHistory.
type AppHistorySpec struct {
Type AppType
TenantID string
Name string
TargetCluster string
Type AppType
TenantID string
Name string
TargetCluster string
TargetNamespace string
// +optional
Histories []History
}
Expand Down Expand Up @@ -186,10 +188,11 @@ func (t ResourceValues) String() string {

// AppResourceSpec is a description of a AppResource.
type AppResourceSpec struct {
Type AppType
TenantID string
Name string
TargetCluster string
Type AppType
TenantID string
Name string
TargetCluster string
TargetNamespace string
// +optional
Resources Resources
}
Expand Down
6 changes: 6 additions & 0 deletions api/application/v1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {
return RegisterDefaults(scheme)
}

func SetDefaults_App(obj *App) {
if len(obj.Spec.TargetNamespace) == 0 {
obj.Spec.TargetNamespace = obj.Namespace
}
}

func SetDefaults_AppSpec(obj *AppSpec) {
if obj.Finalizers == nil || len(obj.Finalizers) == 0 {
obj.Finalizers = []FinalizerName{
Expand Down
327 changes: 224 additions & 103 deletions api/application/v1/generated.pb.go

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions api/application/v1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 21 additions & 18 deletions api/application/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,19 @@ type AppList struct {

// AppSpec is a description of a project.
type AppSpec struct {
Type AppType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=AppType"`
TenantID string `json:"tenantID" protobuf:"bytes,2,opt,name=tenantID"`
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
TargetCluster string `json:"targetCluster" protobuf:"bytes,4,opt,name=targetCluster"`
Type AppType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=AppType"`
TenantID string `json:"tenantID" protobuf:"bytes,2,opt,name=tenantID"`
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
TargetCluster string `json:"targetCluster" protobuf:"bytes,4,opt,name=targetCluster"`
TargetNamespace string `json:"targetNamespace" protobuf:"bytes,5,opt,name=targetNamespace"`
// +optional
Chart Chart `json:"chart" protobuf:"bytes,5,opt,name=chart,casttype=Chart"`
Chart Chart `json:"chart" protobuf:"bytes,6,opt,name=chart,casttype=Chart"`
// Values holds the values for this app.
// +optional
Values AppValues `json:"values,omitempty" protobuf:"bytes,6,opt,name=values,casttype=AppValues"`
Values AppValues `json:"values,omitempty" protobuf:"bytes,7,opt,name=values,casttype=AppValues"`
// +optional
Finalizers []FinalizerName `json:"finalizers,omitempty" protobuf:"bytes,7,rep,name=finalizers,casttype=FinalizerName"`
DryRun bool `json:"dryRun" protobuf:"bytes,8,opt,name=dryRun"`
Finalizers []FinalizerName `json:"finalizers,omitempty" protobuf:"bytes,8,rep,name=finalizers,casttype=FinalizerName"`
DryRun bool `json:"dryRun" protobuf:"bytes,9,opt,name=dryRun"`
}

// Chart is a description of a chart.
Expand Down Expand Up @@ -137,12 +138,13 @@ type AppHistory struct {

// AppHistorySpec is a description of a AppHistory.
type AppHistorySpec struct {
Type AppType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=AppType"`
TenantID string `json:"tenantID" protobuf:"bytes,2,opt,name=tenantID"`
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
TargetCluster string `json:"targetCluster" protobuf:"bytes,4,opt,name=targetCluster"`
Type AppType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=AppType"`
TenantID string `json:"tenantID" protobuf:"bytes,2,opt,name=tenantID"`
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
TargetCluster string `json:"targetCluster" protobuf:"bytes,4,opt,name=targetCluster"`
TargetNamespace string `json:"targetNamespace" protobuf:"bytes,5,opt,name=targetNamespace"`
// +optional
Histories []History `json:"histories,omitempty" protobuf:"bytes,5,opt,name=histories,casttype=History"`
Histories []History `json:"histories,omitempty" protobuf:"bytes,6,opt,name=histories,casttype=History"`
}

// History is a history of a app.
Expand Down Expand Up @@ -186,12 +188,13 @@ func (t ResourceValues) String() string {

// AppResourceSpec is a description of a AppResource.
type AppResourceSpec struct {
Type AppType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=AppType"`
TenantID string `json:"tenantID" protobuf:"bytes,2,opt,name=tenantID"`
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
TargetCluster string `json:"targetCluster" protobuf:"bytes,4,opt,name=targetCluster"`
Type AppType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=AppType"`
TenantID string `json:"tenantID" protobuf:"bytes,2,opt,name=tenantID"`
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
TargetCluster string `json:"targetCluster" protobuf:"bytes,4,opt,name=targetCluster"`
TargetNamespace string `json:"targetNamespace" protobuf:"bytes,5,opt,name=targetNamespace"`
// +optional
Resources Resources `json:"resources,omitempty" protobuf:"bytes,5,opt,name=resources,casttype=Resources"`
Resources Resources `json:"resources,omitempty" protobuf:"bytes,6,opt,name=resources,casttype=Resources"`
}

// AppValues string the values for this app.
Expand Down
6 changes: 6 additions & 0 deletions api/application/v1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/application/v1/zz_generated.defaults.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 21 additions & 3 deletions api/openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions build/docker/tools/provider-res/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ COPY linux-arm64/conntrack-tools-*.tar.gz res/linux-arm64/
COPY linux-amd64/docker-*.tar.gz res/linux-amd64/
COPY linux-arm64/docker-*.tar.gz res/linux-arm64/

COPY linux-amd64/nerdctl-*.tar.gz res/linux-amd64/
COPY linux-arm64/nerdctl-*.tar.gz res/linux-arm64/

COPY linux-amd64/containerd-*.tar.gz res/linux-amd64/
COPY linux-arm64/containerd-*.tar.gz res/linux-arm64/

Expand Down
28 changes: 24 additions & 4 deletions build/docker/tools/provider-res/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,35 @@ function download::docker() {
function download::containerd() {
if [ "${arch}" == "amd64" ]; then
containerd_arch=amd64
for version in ${CONTAINERD_VERSIONS}; do
wget -c "https://github.com/containerd/containerd/releases/download/v${version}/cri-containerd-cni-${version}-linux-${containerd_arch}.tar.gz" \
-O "containerd-${platform}-${version}.tar.gz"
done
elif [ "${arch}" == "arm64" ]; then
containerd_arch=amd64
containerd_arch=arm64
for version in ${CONTAINERD_VERSIONS}; do
wget -c https://tke-release-1251707795.cos.ap-guangzhou.myqcloud.com/cri-containerd-cni-${version}-linux-{containerd_arch}.tar.gz \
-O "containerd-${platform}-${version}.tar.gz"
done
else
echo "[ERROR] Fail to get containerd ${arch} on ${platform} platform."
exit 255
fi
}

function download::nerdctl() {
if [ "${arch}" == "amd64" ]; then
nerdctl_arch=x86_64
elif [ "${arch}" == "arm64" ]; then
nerdctl_arch=arm64
else
echo "[ERROR] Fail to get nerdctl ${arch} on ${platform} platform."
exit 255
fi

for version in ${CONTAINERD_VERSIONS}; do
wget -c "https://github.com/containerd/containerd/releases/download/v${version}/cri-containerd-cni-${version}-linux-${containerd_arch}.tar.gz" \
-O "containerd-${platform}-${version}.tar.gz"
for version in ${NERDCTL_VERSIONS}; do
wget -c "https://github.com/containerd/nerdctl/releases/download/v${version}/nerdctl-${version}-linux-${arch}.tar.gz" \
-O "nerdctl-${platform}-${version}.tar.gz"
done
}

Expand Down Expand Up @@ -148,6 +167,7 @@ for os in ${OSS}; do
download::cni_plugins
download::docker
download::containerd
download::nerdctl
download::critools
download::kubernetes
download::nvidia_driver
Expand Down
12 changes: 10 additions & 2 deletions build/docker/tools/tke-installer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,32 @@
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.

FROM alpine:3.10
FROM alpine:3.14.0

RUN echo "hosts: files dns" >> /etc/nsswitch.conf

WORKDIR /app

ENV PATH="/app/bin:$PATH"
ENV DOCKER_CLI_EXPERIMENTAL=enabled
ARG ENV_ARCH

RUN apk add --no-cache \
bash \
busybox-extras \
curl \
tcpdump \
docker \
ansible
ansible \
containerd

RUN apk --update-cache --repository http:https://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted add lrzsz
RUN wget -O nerdctl-0.10.0-linux.tar.gz https://github.com/containerd/nerdctl/releases/download/v0.10.0/nerdctl-0.10.0-linux-"$ENV_ARCH".tar.gz \
&& tar -zvxf nerdctl-0.10.0-linux.tar.gz -C /usr/local/bin/ \
&& rm -rf nerdctl-0.10.0-linux.tar.gz \
&& wget -O crictl-v1.20.0-linux.tar.gz https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.20.0/crictl-v1.20.0-linux-"$ENV_ARCH".tar.gz \
&& tar -zvxf crictl-v1.20.0-linux.tar.gz -C /usr/local/bin/ \
&& rm -rf crictl-v1.20.0-linux.tar.gz

ADD . /app

Expand Down
Loading

0 comments on commit 4da8f4b

Please sign in to comment.