mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-11 15:39:33 -05:00
AB#2283 Build CCM GCP from github actions in constellation repo (#334)
* Build CCM GCP from github actions in constellation repo * Deploy correct version of GCP CCM
This commit is contained in:
parent
70336e4c9b
commit
d3435b06a2
78
.github/workflows/build-ccm-gcp.yml
vendored
Normal file
78
.github/workflows/build-ccm-gcp.yml
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
name: Build and Upload GCP CCM container image
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
on: [workflow_dispatch]
|
||||
|
||||
# Abort runs of *this* workflow, if a new commit with the same ref is pushed.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-ccm-gcp:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
matrix:
|
||||
version: [v24.0.0, v23.0.0, v22.1.0]
|
||||
include:
|
||||
- version: v24.0.0
|
||||
latest: true
|
||||
steps:
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
with:
|
||||
repository: 'kubernetes/cloud-provider-gcp'
|
||||
ref: refs/tags/ccm/${{ matrix.version }}
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@b2391d37b4157fa4aa2e118d643f417910ff3242
|
||||
with:
|
||||
images: |
|
||||
${{ env.REGISTRY }}/edgelesssys/cloud-provider-gcp
|
||||
flavor: |
|
||||
latest=${{ matrix.latest || false }}
|
||||
tags: |
|
||||
type=semver,pattern=v{{version}},value=${{ matrix.version }}
|
||||
type=semver,pattern=v{{major}}.{{minor}},value=${{ matrix.version }}
|
||||
type=semver,pattern=v{{major}},value=${{ matrix.version }}
|
||||
- name: Set up Docker Buildx
|
||||
id: docker-setup
|
||||
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6
|
||||
- name: Log in to the Container registry
|
||||
id: docker-login
|
||||
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install bazelisk
|
||||
run: |
|
||||
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.12.0/bazelisk-linux-amd64"
|
||||
mkdir -p "${GITHUB_WORKSPACE}/bin/"
|
||||
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
|
||||
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
|
||||
|
||||
- name: Build CCM
|
||||
run: |
|
||||
"${GITHUB_WORKSPACE}/bin/bazel" build //cmd/cloud-controller-manager:cloud-controller-manager
|
||||
- name: Copy CCM
|
||||
run: |
|
||||
cp ./bazel-bin/cmd/cloud-controller-manager/linux_amd64_pure_stripped/cloud-controller-manager ./cloud-controller-manager
|
||||
- name: Prepare Dockerfile
|
||||
run: |
|
||||
cat > Dockerfile <<EOF
|
||||
FROM scratch
|
||||
COPY ./cloud-controller-manager /cloud-controller-manager
|
||||
EOF
|
||||
- name: Build and push container image
|
||||
id: build
|
||||
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
@ -56,7 +56,7 @@ var VersionConfigs map[ValidK8sVersion]KubernetesVersion = map[ValidK8sVersion]K
|
||||
KubectlURL: "https://storage.googleapis.com/kubernetes-release/release/v1.22.12/bin/linux/amd64/kubectl",
|
||||
// CloudControllerManagerImageGCP is the CCM image used on GCP.
|
||||
// TODO: use newer "cloud-provider-gcp" from https://github.com/kubernetes/cloud-provider-gcp when newer releases are available.
|
||||
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:sha-2f6a5b07fc2d37f24f8ff725132f87584d627d8f",
|
||||
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v22",
|
||||
// CloudControllerManagerImageAzure is the CCM image used on Azure.
|
||||
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.1.18",
|
||||
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
|
||||
@ -75,7 +75,7 @@ var VersionConfigs map[ValidK8sVersion]KubernetesVersion = map[ValidK8sVersion]K
|
||||
KubectlURL: "https://storage.googleapis.com/kubernetes-release/release/v1.23.6/bin/linux/amd64/kubectl",
|
||||
// CloudControllerManagerImageGCP is the CCM image used on GCP.
|
||||
// TODO: use newer "cloud-provider-gcp" from https://github.com/kubernetes/cloud-provider-gcp when newer releases are available.
|
||||
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:sha-2f6a5b07fc2d37f24f8ff725132f87584d627d8f",
|
||||
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v23",
|
||||
// CloudControllerManagerImageAzure is the CCM image used on Azure.
|
||||
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.23.11",
|
||||
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
|
||||
@ -94,7 +94,7 @@ var VersionConfigs map[ValidK8sVersion]KubernetesVersion = map[ValidK8sVersion]K
|
||||
KubectlURL: "https://storage.googleapis.com/kubernetes-release/release/v1.24.3/bin/linux/amd64/kubectl",
|
||||
// CloudControllerManagerImageGCP is the CCM image used on GCP.
|
||||
// TODO: use newer "cloud-provider-gcp" from https://github.com/kubernetes/cloud-provider-gcp when newer releases are available.
|
||||
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:sha-2f6a5b07fc2d37f24f8ff725132f87584d627d8f",
|
||||
CloudControllerManagerImageGCP: "ghcr.io/edgelesssys/cloud-provider-gcp:v24",
|
||||
// CloudControllerManagerImageAzure is the CCM image used on Azure.
|
||||
CloudControllerManagerImageAzure: "mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:v1.24.3",
|
||||
// CloudNodeManagerImageAzure is the cloud-node-manager image used on Azure.
|
||||
@ -114,7 +114,7 @@ type KubernetesVersion struct {
|
||||
KubeletURL string // k8s version dependency.
|
||||
KubeadmURL string // k8s version dependency.
|
||||
KubectlURL string // k8s version dependency.
|
||||
CloudControllerManagerImageGCP string // k8s compatibility policy unknown. Using self-built image until resolved: https://github.com/kubernetes/cloud-provider-gcp/issues/289
|
||||
CloudControllerManagerImageGCP string // Using self-built image until resolved: https://github.com/kubernetes/cloud-provider-gcp/issues/289
|
||||
CloudControllerManagerImageAzure string // k8s version dependency.
|
||||
CloudNodeManagerImageAzure string // k8s version dependency. Same version as above.
|
||||
ClusterAutoscalerImage string // Matches k8s versioning scheme.
|
||||
|
Loading…
Reference in New Issue
Block a user