-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
1,951 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
projects/nutanix-cloud-native/cluster-api-provider-nutanix/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cluster-api-provider-nutanix | ||
_output |
1,563 changes: 1,563 additions & 0 deletions
1,563
projects/nutanix-cloud-native/cluster-api-provider-nutanix/ATTRIBUTION.txt
Large diffs are not rendered by default.
Oops, something went wrong.
190 changes: 190 additions & 0 deletions
190
projects/nutanix-cloud-native/cluster-api-provider-nutanix/CHECKSUMS
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
projects/nutanix-cloud-native/cluster-api-provider-nutanix/GIT_TAG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.5.0 |
1 change: 1 addition & 0 deletions
1
projects/nutanix-cloud-native/cluster-api-provider-nutanix/GOLANG_VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.17 |
57 changes: 57 additions & 0 deletions
57
projects/nutanix-cloud-native/cluster-api-provider-nutanix/Help.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
|
||
|
||
########### DO NOT EDIT ############################# | ||
# To update call: make add-generated-help-block | ||
# This is added to help document dynamic targets and support shell autocompletion | ||
|
||
|
||
##@ GIT/Repo Targets | ||
clone-repo: ## Clone upstream `cluster-api-provider-nutanix` | ||
checkout-repo: ## Checkout upstream tag based on value in GIT_TAG file | ||
patch-repo: ## Patch upstream repo with patches in patches directory | ||
|
||
##@ Binary Targets | ||
binaries: ## Build all binaries: `manager` for `linux/amd64 linux/arm64` | ||
_output/bin/cluster-api-provider-nutanix/linux-amd64/manager: ## Build `_output/bin/cluster-api-provider-nutanix/linux-amd64/manager` | ||
_output/bin/cluster-api-provider-nutanix/linux-arm64/manager: ## Build `_output/bin/cluster-api-provider-nutanix/linux-arm64/manager` | ||
|
||
##@ Image Targets | ||
local-images: ## Builds `cluster-api-provider-nutanix/images/amd64` as oci tars for presumbit validation | ||
images: ## Pushes `cluster-api-provider-nutanix/images/push` to IMAGE_REPO | ||
cluster-api-provider-nutanix/images/amd64: ## Builds/pushes `cluster-api-provider-nutanix/images/amd64` | ||
cluster-api-provider-nutanix/images/push: ## Builds/pushes `cluster-api-provider-nutanix/images/push` | ||
|
||
##@ Checksum Targets | ||
checksums: ## Update checksums file based on currently built binaries. | ||
validate-checksums: # Validate checksums of currently built binaries against checksums file. | ||
|
||
##@ Artifact Targets | ||
tarballs: ## Create tarballs by calling build/lib/simple_create_tarballs.sh unless SIMPLE_CREATE_TARBALLS=false, then tarballs must be defined in project Makefile | ||
s3-artifacts: # Prepare ARTIFACTS_PATH folder structure with tarballs/manifests/other items to be uploaded to s3 | ||
upload-artifacts: # Upload tarballs and other artifacts from ARTIFACTS_PATH to S3 | ||
|
||
##@ License Targets | ||
gather-licenses: ## Helper to call $(GATHER_LICENSES_TARGETS) which gathers all licenses | ||
attribution: ## Generates attribution from licenses gathered during `gather-licenses`. | ||
attribution-pr: ## Generates PR to update attribution files for projects | ||
|
||
##@ Clean Targets | ||
clean: ## Removes source and _output directory | ||
clean-repo: ## Removes source directory | ||
|
||
##@ Helpers | ||
help: ## Display this help | ||
add-generated-help-block: ## Add or update generated help block to document project make file and support shell auto completion | ||
|
||
##@Update Helpers | ||
run-target-in-docker: ## Run `MAKE_TARGET` using builder base docker container | ||
update-attribution-checksums-docker: ## Update attribution and checksums using the builder base docker container | ||
stop-docker-builder: ## Clean up builder base docker container | ||
generate: ## Update UPSTREAM_PROJECTS.yaml | ||
create-ecr-repos: ## Create repos in ECR for project images for local testing | ||
|
||
##@ Build Targets | ||
build: ## Called via prow presubmit, calls `validate-checksums attribution local-images upload-artifacts attribution-pr` | ||
release: ## Called via prow postsubmit + release jobs, calls `validate-checksums images upload-artifacts` | ||
########### END GENERATED ########################### |
30 changes: 30 additions & 0 deletions
30
projects/nutanix-cloud-native/cluster-api-provider-nutanix/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
BASE_DIRECTORY:=$(shell git rev-parse --show-toplevel) | ||
GIT_TAG:=$(shell cat GIT_TAG) | ||
GOLANG_VERSION:=$(shell cat GOLANG_VERSION) | ||
|
||
REPO=cluster-api-provider-nutanix | ||
REPO_OWNER=nutanix-cloud-native | ||
|
||
BASE_IMAGE_NAME?=eks-distro-minimal-base | ||
|
||
BINARY_TARGET_FILES=manager | ||
EXTRA_GO_LDFLAGS=$(shell $(BUILD_LIB)/version.sh $(REPO) sigs.k8s.io/cluster-api-provider-nutanix/pkg/version) | ||
|
||
IMAGE_COMPONENT=nutanix-cloud-native/cluster-api-provider-nutanix/release/manager | ||
|
||
HAS_S3_ARTIFACTS=true | ||
|
||
include $(BASE_DIRECTORY)/Common.mk | ||
|
||
s3-artifacts: create-manifests | ||
|
||
.PHONY: create-manifests | ||
create-manifests: tarballs | ||
build/create_manifests.sh $(REPO) $(OUTPUT_DIR) $(ARTIFACTS_PATH) $(GIT_TAG) $(IMAGE_REPO) $(IMAGE_TAG) $(GOLANG_VERSION) | ||
|
||
########### DO NOT EDIT ############################# | ||
# To update call: make add-generated-help-block | ||
# This is added to help document dynamic targets and support shell autocompletion | ||
# Run make help for a formatted help block with all targets | ||
include Help.mk | ||
########### END GENERATED ########################### |
17 changes: 17 additions & 0 deletions
17
projects/nutanix-cloud-native/cluster-api-provider-nutanix/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## **Cluster API Provider for Nutanix** | ||
![Version](https://img.shields.io/badge/version-v0.5.0-blue) | ||
|
||
The [Cluster API Provider for Nutanix (CAPX)](https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix) is a the implementation of Cluster API for Nutanix. | ||
|
||
|
||
### Updating | ||
|
||
1. Review releases and changelogs in upstream [repo](https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix) and decide on the new version. | ||
Please review carefully and if there are questions about changes necessary to eks-anywhere to support the new version | ||
and/or automatically update between eks-anywhere version reach out to @jaxesn, @pokearu or @abhnvp. | ||
2. Update the `GIT_TAG` file to have the new desired version based on the upstream release tags. | ||
3. Check the go.mod file to see if the golang version has changed when updating a version. Update the `GOLANG_VERSION` file to match the version upstream. | ||
4. Compare the old tag to the new, looking specifically for Makefile changes. If `manifests` target has changed in the Makefile, make the required changes in create_manifests.sh | ||
5. Update checksums and attribution using `make update-attribution-checksums-docker`. | ||
6. Update the version at the top of this Readme. | ||
7. Run `make generate` to update the UPSTREAM_PROJECTS.yaml file. |
47 changes: 47 additions & 0 deletions
47
projects/nutanix-cloud-native/cluster-api-provider-nutanix/build/create_manifests.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# 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 -x | ||
set -o errexit | ||
set -o pipefail | ||
|
||
REPO="$1" | ||
OUTPUT_DIR="$2" | ||
ARTIFACTS_PATH="$3" | ||
TAG="$4" | ||
IMAGE_REPO="$5" | ||
IMAGE_TAG="$6" | ||
GOLANG_VERSION="$7" | ||
|
||
MAKE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" | ||
source "${MAKE_ROOT}/../../../build/lib/common.sh" | ||
|
||
build::common::use_go_version $GOLANG_VERSION | ||
|
||
cd $REPO | ||
|
||
yq eval -i -P ".spec.template.spec.containers[0].args += [\"--namespace=eksa-system\"]" config/manager/manager.yaml | ||
|
||
make manifests | ||
|
||
mkdir -p $OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG | ||
cp metadata.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG" | ||
cp templates/cluster-template.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG" | ||
cp config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixclusters.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG" | ||
cp config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachines.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG" | ||
cp config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachinetemplates.yaml "$OUTPUT_DIR/manifests/infrastructure-nutanix/$TAG" | ||
|
||
cp -rf $OUTPUT_DIR/manifests $ARTIFACTS_PATH |
14 changes: 14 additions & 0 deletions
14
projects/nutanix-cloud-native/cluster-api-provider-nutanix/docker/linux/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ARG BASE_IMAGE # https://gallery.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot | ||
FROM $BASE_IMAGE | ||
|
||
ARG TARGETARCH | ||
ARG TARGETOS | ||
|
||
WORKDIR / | ||
|
||
COPY _output/bin/cluster-api-provider-nutanix/$TARGETOS-$TARGETARCH/manager /manager | ||
COPY _output/LICENSES /LICENSES | ||
COPY ATTRIBUTION.txt /ATTRIBUTION.txt | ||
|
||
USER 65532 | ||
ENTRYPOINT ["/manager"] |
18 changes: 18 additions & 0 deletions
18
projects/nutanix-cloud-native/cluster-api-provider-nutanix/expected_artifacts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
SHA256SUM | ||
SHA256SUM.sha256 | ||
SHA256SUM.sha512 | ||
SHA512SUM | ||
SHA512SUM.sha256 | ||
SHA512SUM.sha512 | ||
cluster-api-provider-nutanix-linux-amd64-$GIT_TAG.tar.gz | ||
cluster-api-provider-nutanix-linux-amd64-$GIT_TAG.tar.gz.sha256 | ||
cluster-api-provider-nutanix-linux-amd64-$GIT_TAG.tar.gz.sha512 | ||
cluster-api-provider-nutanix-linux-arm64-$GIT_TAG.tar.gz | ||
cluster-api-provider-nutanix-linux-arm64-$GIT_TAG.tar.gz.sha256 | ||
cluster-api-provider-nutanix-linux-arm64-$GIT_TAG.tar.gz.sha512 | ||
githash | ||
manifests/infrastructure-nutanix/$GIT_TAG/cluster-template.yaml | ||
manifests/infrastructure-nutanix/$GIT_TAG/infrastructure.cluster.x-k8s.io_nutanixclusters.yaml | ||
manifests/infrastructure-nutanix/$GIT_TAG/infrastructure.cluster.x-k8s.io_nutanixmachines.yaml | ||
manifests/infrastructure-nutanix/$GIT_TAG/infrastructure.cluster.x-k8s.io_nutanixmachinetemplates.yaml | ||
manifests/infrastructure-nutanix/$GIT_TAG/metadata.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters