Skip to content

Commit

Permalink
review comments fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakm-ntnx committed Feb 27, 2024
1 parent 59909ad commit 25aeaf6
Show file tree
Hide file tree
Showing 10 changed files with 238 additions and 9 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/nutanix_clusterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ func (NutanixControlPlaneEndpointSpec) VariableSchema() clusterv1.VariableSchema
Type: "object",
Properties: map[string]clusterv1.JSONSchemaProps{
"host": {
Description: "host ip/fqdn for control plane api server",
Description: "host ip/fqdn for control plane API Server",
Type: "string",
},
"port": {
Description: "port for control plane api server",
Description: "port for control plane API Server",
Type: "integer",
},
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func main() {
dockermutation.MetaWorkerPatchHandler(),
}

// dnutanixMetaHandlers combines all Nutanix patch and variable handlers under a single handler.
// nutanixMetaHandlers combines all Nutanix patch and variable handlers under a single handler.
// It allows to specify configuration under a single variable.
nutanixMetaHandlers := []handlers.Named{
nutanixclusterconfig.NewVariable(),
Expand Down
114 changes: 114 additions & 0 deletions examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,119 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: nutanix
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
cluster.x-k8s.io/provider: infrastructure-nutanix
name: ${CLUSTER_NAME}
spec:
clusterNetwork:
pods:
cidrBlocks:
- ${POD_CIDR:-192.168.0.0/16}
serviceDomain: cluster.local
services:
cidrBlocks:
- ${SERVICE_CIDR:-10.128.0.0/12}
topology:
class: test-cre
controlPlane:
metadata: {}
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
variables:
- name: clusterConfig
value:
addons:
cni:
provider: Cilium
strategy: ClusterResourceSet
nutanix: {}
version: ${KUBERNETES_VERSION}
workers:
machineDeployments:
- class: ${CLUSTER_CLASS_NAME}-worker
metadata: {}
name: md-0
replicas: ${WORKER_MACHINE_COUNT}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: nutanix
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
cluster.x-k8s.io/provider: infrastructure-nutanix
name: ${CLUSTER_NAME}
spec:
clusterNetwork:
pods:
cidrBlocks:
- ${POD_CIDR:-192.168.0.0/16}
serviceDomain: cluster.local
services:
cidrBlocks:
- ${SERVICE_CIDR:-10.128.0.0/12}
topology:
class: test-cre
controlPlane:
metadata: {}
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
variables:
- name: clusterConfig
value:
addons:
cni:
provider: Cilium
strategy: HelmAddon
nutanix: {}
version: ${KUBERNETES_VERSION}
workers:
machineDeployments:
- class: ${CLUSTER_CLASS_NAME}-worker
metadata: {}
name: md-0
replicas: ${WORKER_MACHINE_COUNT}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: nutanix
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
cluster.x-k8s.io/provider: infrastructure-nutanix
name: ${CLUSTER_NAME}
spec:
clusterNetwork:
pods:
cidrBlocks:
- ${POD_CIDR:-192.168.0.0/16}
serviceDomain: cluster.local
services:
cidrBlocks:
- ${SERVICE_CIDR:-10.128.0.0/12}
topology:
class: test-cre
controlPlane:
metadata: {}
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
variables:
- name: clusterConfig
value:
addons:
cni:
provider: Calico
strategy: ClusterResourceSet
nutanix: {}
version: ${KUBERNETES_VERSION}
workers:
machineDeployments:
- class: ${CLUSTER_CLASS_NAME}-worker
metadata: {}
name: md-0
replicas: ${WORKER_MACHINE_COUNT}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: nutanix
Expand Down
116 changes: 115 additions & 1 deletion examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,120 @@ spec:
addons:
cni:
provider: Cilium
strategy: ClusterResourceSet
nutanix: {}
version: ${KUBERNETES_VERSION}
workers:
machineDeployments:
- class: ${CLUSTER_CLASS_NAME}-worker
metadata: {}
name: md-0
replicas: ${WORKER_MACHINE_COUNT}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: nutanix
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
cluster.x-k8s.io/provider: infrastructure-nutanix
name: ${CLUSTER_NAME}
spec:
clusterNetwork:
pods:
cidrBlocks:
- ${POD_CIDR:-192.168.0.0/16}
serviceDomain: cluster.local
services:
cidrBlocks:
- ${SERVICE_CIDR:-10.128.0.0/12}
topology:
class: test-cre
controlPlane:
metadata: {}
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
variables:
- name: clusterConfig
value:
addons:
cni:
provider: Cilium
strategy: HelmAddon
nutanix: {}
version: ${KUBERNETES_VERSION}
workers:
machineDeployments:
- class: ${CLUSTER_CLASS_NAME}-worker
metadata: {}
name: md-0
replicas: ${WORKER_MACHINE_COUNT}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: nutanix
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
cluster.x-k8s.io/provider: infrastructure-nutanix
name: ${CLUSTER_NAME}
spec:
clusterNetwork:
pods:
cidrBlocks:
- ${POD_CIDR:-192.168.0.0/16}
serviceDomain: cluster.local
services:
cidrBlocks:
- ${SERVICE_CIDR:-10.128.0.0/12}
topology:
class: test-cre
controlPlane:
metadata: {}
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
variables:
- name: clusterConfig
value:
addons:
cni:
provider: Calico
strategy: ClusterResourceSet
nutanix: {}
version: ${KUBERNETES_VERSION}
workers:
machineDeployments:
- class: ${CLUSTER_CLASS_NAME}-worker
metadata: {}
name: md-0
replicas: ${WORKER_MACHINE_COUNT}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: nutanix
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
cluster.x-k8s.io/provider: infrastructure-nutanix
name: ${CLUSTER_NAME}
spec:
clusterNetwork:
pods:
cidrBlocks:
- ${POD_CIDR:-192.168.0.0/16}
serviceDomain: cluster.local
services:
cidrBlocks:
- ${SERVICE_CIDR:-10.128.0.0/12}
topology:
class: test-cre
controlPlane:
metadata: {}
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
variables:
- name: clusterConfig
value:
addons:
cni:
provider: Calico
strategy: HelmAddon
nutanix: {}
version: ${KUBERNETES_VERSION}
Expand All @@ -34,4 +148,4 @@ spec:
- class: ${CLUSTER_CLASS_NAME}-worker
metadata: {}
name: md-0
replicas: ${WORKER_MACHINE_COUNT}
replicas: ${WORKER_MACHINE_COUNT}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/v1.4.0-alpha.1/cluster-template-topology.yaml
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/${CAPX_VERSION}/cluster-template-topology.yaml

patches:
- target:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/v1.4.0-alpha.1/cluster-template-topology.yaml
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/${CAPX_VERSION}/cluster-template-topology.yaml

patches:
- target:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/v1.4.0-alpha.1/cluster-template-topology.yaml
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/${CAPX_VERSION}/cluster-template-topology.yaml

patches:
- target:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/v1.4.0-alpha.1/cluster-template-topology.yaml
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/${CAPX_VERSION}/cluster-template-topology.yaml

patches:
- target:
Expand Down
2 changes: 1 addition & 1 deletion hack/examples/bases/nutanix/kustomization.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- ./cilium/helm-addon
- ./calico/crs
- ./calico/helm-addon
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/v1.4.0-alpha.1/cluster-template-clusterclass.yaml
- https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/download/${CAPX_VERSION}/cluster-template-clusterclass.yaml

namePrefix:

Expand Down
1 change: 1 addition & 0 deletions make/examples.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export KUBERNETES_VERSION := v1.27.5

export CLUSTERCTL_VERSION := $(shell clusterctl version -o short 2>/dev/null)
export CAPA_VERSION := $(shell cd hack/third-party/capa && go list -m -f '{{ .Version }}' sigs.k8s.io/cluster-api-provider-aws/v2)
export CAPX_VERSION := $(shell cd hack/third-party/capx && go list -m -f '{{ .Version }}' github.com/nutanix-cloud-native/cluster-api-provider-nutanix)

.PHONY: examples.sync
examples.sync: ## Syncs the examples by fetching upstream examples and applying kustomize patches
Expand Down

0 comments on commit 25aeaf6

Please sign in to comment.