Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

fix: rename to CCM #11

Merged
merged 1 commit into from
Mar 29, 2024
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
10 changes: 5 additions & 5 deletions api/v1alpha1/addon_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Addons struct {
ClusterAutoscaler *ClusterAutoscaler `json:"clusterAutoscaler,omitempty"`

// +optional
CPI *CPI `json:"cpi,omitempty"`
CCM *CCM `json:"ccm,omitempty"`

// +optional
CSIProviders *CSIProviders `json:"csi,omitempty"`
Expand All @@ -36,7 +36,7 @@ func (Addons) VariableSchema() clusterv1.VariableSchema {
"nfd": NFD{}.VariableSchema().OpenAPIV3Schema,
"clusterAutoscaler": ClusterAutoscaler{}.VariableSchema().OpenAPIV3Schema,
"csi": CSIProviders{}.VariableSchema().OpenAPIV3Schema,
"cpi": CPI{}.VariableSchema().OpenAPIV3Schema,
"ccm": CCM{}.VariableSchema().OpenAPIV3Schema,
},
},
}
Expand Down Expand Up @@ -173,10 +173,10 @@ func (CSIProviders) VariableSchema() clusterv1.VariableSchema {
}
}

// CPI tells us to enable or disable the cloud provider interface.
type CPI struct{}
// CCM tells us to enable or disable the cloud provider interface.
type CCM struct{}

func (CPI) VariableSchema() clusterv1.VariableSchema {
func (CCM) VariableSchema() clusterv1.VariableSchema {
return clusterv1.VariableSchema{
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
Type: "object",
Expand Down
14 changes: 7 additions & 7 deletions api/v1alpha1/clusterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ const (

CSIProviderAWSEBS = "aws-ebs"

CPIProviderAWS = "aws"
CCMProviderAWS = "aws"
)

//+kubebuilder:object:root=true
// +kubebuilder:object:root=true

// ClusterConfig is the Schema for the clusterconfigs API.
type ClusterConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

//+optional
// +optional
Spec ClusterConfigSpec `json:"spec,omitempty"`
}

Expand All @@ -43,7 +43,7 @@ type ClusterConfigSpec struct {

GenericClusterConfig `json:",inline"`

//+optional
// +optional
ControlPlane *NodeConfigSpec `json:"controlPlane,omitempty"`
}

Expand Down Expand Up @@ -140,11 +140,11 @@ func (v KubernetesImageRepository) String() string {

type Image struct {
// Repository is used to override the image repository to pull from.
//+optional
// +optional
Repository string `json:"repository,omitempty"`

// Tag is used to override the default image tag.
//+optional
// +optional
Tag string `json:"tag,omitempty"`
}

Expand All @@ -170,7 +170,7 @@ func (Image) VariableSchema() clusterv1.VariableSchema {

type Etcd struct {
// Image required for overriding etcd image details.
//+optional
// +optional
Image *Image `json:"image,omitempty"`
}

Expand Down
22 changes: 11 additions & 11 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

#=================================================================
# DO NOT EDIT THIS FILE
# IT HAS BEEN GENERATED BY /hack/addons/update-aws-cpi.sh
# IT HAS BEEN GENERATED BY /hack/addons/update-aws-ccm.sh
#=================================================================
apiVersion: v1
data:
aws-cpi-v1.27.1.yaml: |
aws-ccm-v1.27.1.yaml: |
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -185,4 +185,4 @@ data:
kind: ConfigMap
metadata:
creationTimestamp: null
name: aws-cpi-v1.27.1
name: aws-ccm-v1.27.1
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

#=================================================================
# DO NOT EDIT THIS FILE
# IT HAS BEEN GENERATED BY /hack/addons/update-aws-cpi.sh
# IT HAS BEEN GENERATED BY /hack/addons/update-aws-ccm.sh
#=================================================================
apiVersion: v1
data:
aws-cpi-v1.28.1.yaml: |
aws-ccm-v1.28.1.yaml: |
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -185,4 +185,4 @@ data:
kind: ConfigMap
metadata:
creationTimestamp: null
name: aws-cpi-v1.28.1
name: aws-ccm-v1.28.1
2 changes: 1 addition & 1 deletion examples/capi-quick-start/aws-cluster-calico-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ spec:
- name: clusterConfig
value:
addons:
ccm: {}
clusterAutoscaler:
strategy: ClusterResourceSet
cni:
provider: Calico
strategy: ClusterResourceSet
cpi: {}
csi:
providers:
- name: aws-ebs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ spec:
- name: clusterConfig
value:
addons:
ccm: {}
clusterAutoscaler:
strategy: HelmAddon
cni:
provider: Calico
strategy: HelmAddon
cpi: {}
csi:
providers:
- name: aws-ebs
Expand Down
2 changes: 1 addition & 1 deletion examples/capi-quick-start/aws-cluster-cilium-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ spec:
- name: clusterConfig
value:
addons:
ccm: {}
clusterAutoscaler:
strategy: ClusterResourceSet
cni:
provider: Cilium
strategy: ClusterResourceSet
cpi: {}
csi:
providers:
- name: aws-ebs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ spec:
- name: clusterConfig
value:
addons:
ccm: {}
clusterAutoscaler:
strategy: HelmAddon
cni:
provider: Cilium
strategy: HelmAddon
cpi: {}
csi:
providers:
- name: aws-ebs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

metadata:
name: aws-cpi-kustomize
name: aws-ccm-kustomize

helmCharts:
- name: aws-cloud-controller-manager
repo: https://kubernetes.github.io/cloud-provider-aws
releaseName: aws-cloud-controller-manager
version: ${AWS_CPI_CHART_VERSION}
version: ${AWS_CCM_CHART_VERSION}
includeCRDs: true
skipTests: true

Expand All @@ -25,4 +25,4 @@ patches:

images:
- name: registry.k8s.io/provider-aws/cloud-controller-manager
newTag: ${AWS_CPI_VERSION}
newTag: ${AWS_CCM_VERSION}
26 changes: 13 additions & 13 deletions hack/addons/update-aws-cpi.sh → hack/addons/update-aws-ccm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@ readonly SCRIPT_DIR
# shellcheck source=hack/common.sh
source "${SCRIPT_DIR}/../common.sh"

AWS_CPI_VERSION=$1
export AWS_CPI_VERSION
AWS_CPI_CHART_VERSION=$2
export AWS_CPI_CHART_VERSION
AWS_CCM_VERSION=$1
export AWS_CCM_VERSION
AWS_CCM_CHART_VERSION=$2
export AWS_CCM_CHART_VERSION

if [ -z "${AWS_CPI_VERSION:-}" ]; then
echo "Missing argument: AWS_CPI_VERSION"
if [ -z "${AWS_CCM_VERSION:-}" ]; then
echo "Missing argument: AWS_CCM_VERSION"
exit 1
fi

ASSETS_DIR="$(mktemp -d -p "${TMPDIR:-/tmp}")"
readonly ASSETS_DIR
trap_add "rm -rf ${ASSETS_DIR}" EXIT

readonly KUSTOMIZE_BASE_DIR="${SCRIPT_DIR}/kustomize/aws-cpi/"
readonly KUSTOMIZE_BASE_DIR="${SCRIPT_DIR}/kustomize/aws-ccm/"
envsubst -no-unset <"${KUSTOMIZE_BASE_DIR}/kustomization.yaml.tmpl" >"${ASSETS_DIR}/kustomization.yaml"

readonly FILE_NAME="aws-cpi-${AWS_CPI_VERSION}.yaml"
readonly FILE_NAME="aws-ccm-${AWS_CCM_VERSION}.yaml"
kustomize build --enable-helm "${ASSETS_DIR}" >"${ASSETS_DIR}/${FILE_NAME}"

kubectl create configmap aws-cpi-"${AWS_CPI_VERSION}" --dry-run=client --output yaml \
kubectl create configmap aws-ccm-"${AWS_CCM_VERSION}" --dry-run=client --output yaml \
--from-file "${ASSETS_DIR}/${FILE_NAME}" \
>"${ASSETS_DIR}/aws-cpi-${AWS_CPI_VERSION}-configmap.yaml"
>"${ASSETS_DIR}/aws-ccm-${AWS_CCM_VERSION}-configmap.yaml"

# add warning not to edit file directly
cat <<EOF >"${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/templates/cpi/aws/manifests/aws-cpi-${AWS_CPI_VERSION}-configmap.yaml"
cat <<EOF >"${GIT_REPO_ROOT}/charts/cluster-api-runtime-extensions-nutanix/templates/ccm/aws/manifests/aws-ccm-${AWS_CCM_VERSION}-configmap.yaml"
$(cat "${GIT_REPO_ROOT}/hack/license-header.yaml.txt")

#=================================================================
# DO NOT EDIT THIS FILE
# IT HAS BEEN GENERATED BY /hack/addons/update-aws-cpi.sh
# IT HAS BEEN GENERATED BY /hack/addons/update-aws-ccm.sh
#=================================================================
$(cat "${ASSETS_DIR}/aws-cpi-${AWS_CPI_VERSION}-configmap.yaml")
$(cat "${ASSETS_DIR}/aws-ccm-${AWS_CCM_VERSION}-configmap.yaml")
EOF
2 changes: 1 addition & 1 deletion hack/examples/bases/aws/cluster/kustomization.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ patches:
path: ../../../patches/cluster-autoscaler.yaml
- target:
kind: Cluster
path: ../../../patches/cpi.yaml
path: ../../../patches/ccm.yaml
- target:
kind: Cluster
path: ../../../patches/aws/csi.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# SPDX-License-Identifier: Apache-2.0

- op: "add"
path: "/spec/topology/variables/0/value/addons/cpi"
path: "/spec/topology/variables/0/value/addons/ccm"
value: {}
18 changes: 9 additions & 9 deletions make/addons.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export NODE_FEATURE_DISCOVERY_VERSION := $(shell goprintconst -file pkg/handlers
export CLUSTER_AUTOSCALER_VERSION := 9.35.0
export AWS_CSI_SNAPSHOT_CONTROLLER_VERSION := v6.3.3
export AWS_EBS_CSI_CHART_VERSION := v2.28.1
# a map of AWS CPI versions
export AWS_CPI_VERSION_127 := v1.27.1
export AWS_CPI_CHART_VERSION_127 := 0.0.8
export AWS_CPI_VERSION_128 := v1.28.1
export AWS_CPI_CHART_VERSION_128 := 0.0.8
# a map of AWS CCM versions
export AWS_CCM_VERSION_127 := v1.27.1
export AWS_CCM_CHART_VERSION_127 := 0.0.8
export AWS_CCM_VERSION_128 := v1.28.1
export AWS_CCM_CHART_VERSION_128 := 0.0.8

.PHONY: addons.sync
addons.sync: $(addprefix update-addon.,calico cilium nfd cluster-autoscaler aws-ebs-csi aws-cpi.127 aws-cpi.128)
addons.sync: $(addprefix update-addon.,calico cilium nfd cluster-autoscaler aws-ebs-csi aws-ccm.127 aws-ccm.128)

.PHONY: update-addon.calico
update-addon.calico: ; $(info $(M) updating calico manifests)
Expand All @@ -36,6 +36,6 @@ update-addon.cluster-autoscaler: ; $(info $(M) updating cluster-autoscaler manif
update-addon.aws-ebs-csi: ; $(info $(M) updating aws ebs csi manifests)
./hack/addons/update-aws-ebs-csi.sh

.PHONY: update-addon.aws-cpi.%
update-addon.aws-cpi.%: ; $(info $(M) updating aws cpi $* manifests)
./hack/addons/update-aws-cpi.sh $(AWS_CPI_VERSION_$*) $(AWS_CPI_CHART_VERSION_$*)
.PHONY: update-addon.aws-ccm.%
update-addon.aws-ccm.%: ; $(info $(M) updating aws ccm $* manifests)
./hack/addons/update-aws-ccm.sh $(AWS_CCM_VERSION_$*) $(AWS_CCM_CHART_VERSION_$*)
Loading
Loading