Skip to content
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

feat:add manual release #3342

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
44 changes: 5 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -302,59 +302,25 @@ gke-addon-poststart:
operator-manager-bin:
go build -o bin/operator-manager github.com/GoogleCloudPlatform/k8s-config-connector/operator/cmd/manager

# Build kcc manifests for both standard and autopilot clusters
.PHONY: all-manifests
all-manifests: crd-manifests rbac-manifests build-operator-manifests
cp config/installbundle/release-manifests/crds.yaml config/installbundle/release-manifests/standard/crds.yaml
cp config/installbundle/release-manifests/rbac.yaml config/installbundle/release-manifests/standard/rbac.yaml
kustomize build config/installbundle/release-manifests/standard -o config/installbundle/release-manifests/standard/manifests.yaml
cp config/installbundle/release-manifests/crds.yaml config/installbundle/release-manifests/autopilot/crds.yaml
cp config/installbundle/release-manifests/rbac.yaml config/installbundle/release-manifests/autopilot/rbac.yaml
kustomize build config/installbundle/release-manifests/autopilot -o config/installbundle/release-manifests/autopilot/manifests.yaml


# Build kcc manifests for standard GKE clusters
.PHONY: config-connector-manifests-standard
config-connector-manifests-standard: build-crd-manifests build-rbac-manifests build-operator-manifests
cp config/installbundle/release-manifests/crds.yaml config/installbundle/release-manifests/standard/crds.yaml
cp config/installbundle/release-manifests/rbac.yaml config/installbundle/release-manifests/standard/rbac.yaml
kustomize build config/installbundle/release-manifests/standard -o config/installbundle/release-manifests/standard/manifests.yaml
config-connector-manifests-standard: build-operator-manifests
kustomize build config/installbundle/release-manifests/standard

# Build kcc manifests for autopilot clusters
.PHONY: config-connector-manifests-autopilot
config-connector-manifests-autopilot: build-crd-manifests build-rbac-manifests build-operator-manifests
cp config/installbundle/release-manifests/crds.yaml config/installbundle/release-manifests/autopilot/crds.yaml
cp config/installbundle/release-manifests/rbac.yaml config/installbundle/release-manifests/autopilot/rbac.yaml
kustomize build config/installbundle/release-manifests/autopilot -o config/installbundle/release-manifests/autopilot/manifests.yaml

.PHONY: build-crd-manifests
build-crd-manifests:
go run sigs.k8s.io/controller-tools/cmd/[email protected] crd paths="./operator/pkg/apis/..." output:crd:artifacts:config=operator/config/crd/bases
kustomize build operator/config/crd -o config/installbundle/release-manifests/crds.yaml

.PHONY: build-rbac-manifests
build-rbac-manifests:
kustomize build operator/config/rbac -o config/installbundle/release-manifests/rbac.yaml
config-connector-manifests-autopilot: build-operator-manifests
kustomize build config/installbundle/release-manifests/autopilot

.PHONY: build-operator-manifests
build-operator-manifests:
go run sigs.k8s.io/controller-tools/cmd/[email protected] crd paths="./operator/pkg/apis/..." output:crd:artifacts:config=operator/config/crd/bases
make -C operator docker-build
kustomize build operator/config/autopilot-manager -o config/installbundle/release-manifests/autopilot/manager.yaml
kustomize build operator/config/manager -o config/installbundle/release-manifests/standard/manager.yaml

.PHONY: push-operator-manifest
push-operator-manifest:
make -C operator docker-push

.PHONY: clean-operator-manifests
clean-release-manifests:
rm config/installbundle/release-manifests/crds.yaml
rm config/installbundle/release-manifests/rbac.yaml
rm config/installbundle/release-manifests/standard/manager.yaml
rm config/installbundle/release-manifests/autopilot/manager.yaml
rm config/installbundle/release-manifests/standard/manifests.yaml
rm config/installbundle/release-manifests/autopilot/manifests.yaml

.PHONY: deploy-kcc-standard
deploy-kcc-standard: docker-build docker-push config-connector-manifests-standard push-operator-manifest
kubectl apply -f config/installbundle/release-manifests/standard/manifests.yaml ${CONTEXT_FLAG}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ commonLabels:
commonAnnotations:
cnrm.cloud.google.com/operator-version: "1.126.0"
resources:
- crds.yaml
- rbac.yaml
- manager.yaml
- ../../../../operator/config/rbac
- ../../../../operator/config/crd
- ../../../../operator/config/autopilot-manager
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ commonLabels:
commonAnnotations:
cnrm.cloud.google.com/operator-version: "1.126.0"
resources:
- crds.yaml
- rbac.yaml
- manager.yaml
- ../../../../operator/config/rbac
- ../../../../operator/config/crd
- ../../../../operator/config/manager
43 changes: 43 additions & 0 deletions dev/tasks/deploy-release-manual
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

# runs the config-connector build across all desired systems and architectures and creates a release tarball
REPO_ROOT="$(git rev-parse --show-toplevel)"
cd ${REPO_ROOT}


BUILD_DIR="${REPO_ROOT}/.build"
mkdir -p "${BUILD_DIR}"


MANUAL_DIR="${BUILD_DIR}/manual-release"
mkdir -p "${MANUAL_DIR}/operator-system"

# New process
kustomize build config/installbundle/release-manifests/standard -o ${MANUAL_DIR}/operator-system/configconnector-operator.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we plan to check in these files? Maybe we can have a bot periodically run the kustomize build and check in the final yaml files.

echo "Added standard release manifest to ${MANUAL_DIR}/operator-system/configconnector-operator.yaml"

kustomize build config/installbundle/release-manifests/autopilot -o ${MANUAL_DIR}/operator-system/autopilot-configconnector-operator.yaml
echo "Added autopilot release manifest to ${MANUAL_DIR}/operator-system/autopilot-configconnector-operator.yaml"

cp -rf operator/config/samples ${MANUAL_DIR}/

tar -czvf ${BUILD_DIR}/release-bundle.tar.gz -C ${MANUAL_DIR}/ .

echo "Generated ${BUILD_DIR}/release-bundle.tar.gz for manual installation "
Loading