Skip to content

Unified k8s version #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/call-offline-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
required: true
type: string

env:
KUBE_VERSION: v1.24.7

jobs:
offline-build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,6 +39,7 @@ jobs:
env:
KUBEAN_TAG: ${{ github.ref_name }}
KUBESPRAY_TAG: ${{ env.SPRAY_SHA_SHORT }}
KUBE_VERSION: ${{ env.KUBE_VERSION }}
run: |
bash artifacts/manage_version_cr.sh create_manifest
bash artifacts/manage_version_cr.sh create_localartifactset
Expand All @@ -60,6 +64,7 @@ jobs:
env:
KUBEAN_TAG: ${{ github.ref_name }}
ARCH: amd64
KUBE_VERSION: ${{ env.KUBE_VERSION }}
run: |
OFFLINE_PACKAGE_DIR=${KUBEAN_TAG}/${ARCH}
bash artifacts/generate_offline_package.sh all
Expand All @@ -75,6 +80,7 @@ jobs:
env:
KUBEAN_TAG: ${{ github.ref_name }}
ARCH: arm64
KUBE_VERSION: ${{ env.KUBE_VERSION }}
run: |
OFFLINE_PACKAGE_DIR=${KUBEAN_TAG}/${ARCH}
bash artifacts/generate_offline_package.sh all
Expand Down
9 changes: 7 additions & 2 deletions artifacts/generate_offline_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eo pipefail

OPTION=${1:-'all'}
KUBEAN_TAG=${KUBEAN_TAG:-"v0.1.0"}
KUBE_VERSION=${KUBE_VERSION:-"v1.24.7"}
KUBE_VERSION=${KUBE_VERSION:-""}

CURRENT_DIR=$(pwd)
ARCH=${ARCH:-"amd64"}
Expand Down Expand Up @@ -37,7 +37,12 @@ function generate_temp_list() {
fi
echo "$CURRENT_DIR/kubespray"
cd $CURRENT_DIR/kubespray
bash contrib/offline/generate_list.sh -e"image_arch=${ARCH}" -e"kube_version=${KUBE_VERSION}"

if [ -z "${KUBE_VERSION}" ]; then
bash contrib/offline/generate_list.sh -e"image_arch=${ARCH}"
else
bash contrib/offline/generate_list.sh -e"image_arch=${ARCH}" -e"kube_version=${KUBE_VERSION}"
fi

# Clean up unused images
remove_images="aws-alb|aws-ebs|cert-manager|netchecker|weave|sig-storage|external_storage|cinder-csi|kubernetesui|flannel"
Expand Down
19 changes: 14 additions & 5 deletions artifacts/manage_version_cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OPTION=${1:-'create_localartifactset'} ## create_localartifactset create_manife

KUBESPRAY_TAG=${KUBESPRAY_TAG:-"v2.19.0"} ## env from github action
KUBEAN_TAG=${KUBEAN_TAG:-"v0.1.0"} ## env from github action
KUBE_VERSION=${KUBE_VERSION:-"v1.24.7"}
KUBE_VERSION=${KUBE_VERSION:-""}

CURRENT_DIR=$(cd $(dirname $0); pwd) ## artifacts dir
CURRENT_DATE=$(date +%Y%m%d)
Expand Down Expand Up @@ -87,8 +87,13 @@ function update_docker_offline_version() {
function create_offline_version_cr() {
cni_version=$(extract_version "cni_version")
containerd_version=$(extract_version "containerd_version")
# kube_version=$(extract_version "kube_version" "kubespray-defaults")
kube_version=${KUBE_VERSION}

if [ -z "${KUBE_VERSION}" ]; then
kube_version=$(extract_version "kube_version" "kubespray-defaults")
else
kube_version=${KUBE_VERSION}
fi

calico_version=$(extract_version "calico_version")
cilium_version=$(extract_version "cilium_version")
etcd_version=$(extract_etcd_version "$kube_version")
Expand Down Expand Up @@ -147,8 +152,12 @@ function create_info_manifest_cr() {
containerd_version_default=$(extract_version "containerd_version")
containerd_version_range=$(extract_version_range ".containerd_archive_checksums.amd64")

# kube_version_default=$(extract_version "kube_version" "kubespray-defaults")
kube_version_default=${kube_version}
if [ -z "${KUBE_VERSION}" ]; then
kube_version_default=$(extract_version "kube_version" "kubespray-defaults")
else
kube_version_default=${KUBE_VERSION}
fi

kube_version_range=$(extract_version_range ".kubelet_checksums.amd64")

calico_version_default=$(extract_version "calico_version")
Expand Down
7 changes: 3 additions & 4 deletions build/images/kubean-operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ FROM golang:1.17.3 as build

WORKDIR /kubean

# ENV GO111MODULE=on \
# GOPROXY=https://goproxy.cn,direct
ENV GO111MODULE=on
ENV GO111MODULE=on \
GOPROXY=https://goproxy.cn,direct

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -o kubean-operator ./cmd/kubean-operator/main.go

FROM alpine:3.15

# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

COPY --from=build /kubean/kubean-operator /bin/

Expand Down