From 646d232f35c786b1f2c556f2ffc3d577a9117a7e Mon Sep 17 00:00:00 2001 From: lreciomelero Date: Mon, 27 Mar 2023 14:03:16 +0200 Subject: [PATCH 01/20] fixed descriptro credentials removing --- .../create/actions/createworker/utils.go | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/pkg/cluster/internal/create/actions/createworker/utils.go b/pkg/cluster/internal/create/actions/createworker/utils.go index 0a1fc645b0..7302450bcf 100644 --- a/pkg/cluster/internal/create/actions/createworker/utils.go +++ b/pkg/cluster/internal/create/actions/createworker/utils.go @@ -331,7 +331,7 @@ func rewriteDescriptorFile(descriptorPath string) error { return err } - yamlNodes := removeKey(data.Content, "credentials") + yamlNodes := removeNodesUnderKey(data.Content, "spec", "credentials") b, err := yaml.Marshal(yamlNodes[0]) @@ -491,3 +491,35 @@ func getEcrAuthToken(p ProviderParams) (string, error) { parts := strings.SplitN(string(data), ":", 2) return parts[1], nil } + +func removeNodesUnderKey(nodes []*yaml.Node, parentKey string, childKey string) []*yaml.Node { + for i, node := range nodes { + if node.Kind == yaml.MappingNode { + for j := 0; j < len(node.Content); j += 2 { + keyNode := node.Content[j] + valueNode := node.Content[j+1] + if keyNode.Value == parentKey { + // Se encontró el nodo padre. + if valueNode.Kind == yaml.MappingNode { + // Eliminar todos los nodos que coincidan con la key debajo del nodo padre. + for k := 0; k < len(valueNode.Content); k += 2 { + childKeyNode := valueNode.Content[k] + if childKeyNode.Value == childKey { + valueNode.Content = append(valueNode.Content[:k], valueNode.Content[k+2:]...) + k -= 2 // Se elimina un par clave-valor, por lo que debemos retroceder el índice. + } + } + } + break // Ya no es necesario continuar buscando. + } else { + removeNodesUnderKey([]*yaml.Node{valueNode}, parentKey, childKey) // Buscar recursivamente en los nodos hijos. + } + } + nodes[i].Content = removeNodesUnderKey(node.Content, parentKey, childKey) + } else if node.Kind == yaml.SequenceNode { + // Buscar recursivamente en los elementos de la secuencia. + nodes[i].Content = removeNodesUnderKey(node.Content, parentKey, childKey) + } + } + return nodes +} From 9e2a2dfab15159e9093f4608064a20df2d36f527 Mon Sep 17 00:00:00 2001 From: Santiago Sanchez Paz Date: Mon, 27 Mar 2023 17:45:54 +0200 Subject: [PATCH 02/20] Minor Fixes --- .../internal/create/actions/cluster/cluster.go | 18 +++++++----------- .../actions/cluster/templates/aws.eks.tmpl | 4 ++-- .../create/actions/cluster/templates/gcp.tmpl | 2 +- .../actions/createworker/keosinstaller.go | 4 ++-- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/pkg/cluster/internal/create/actions/cluster/cluster.go b/pkg/cluster/internal/create/actions/cluster/cluster.go index 72a5dd8f91..0d9468c797 100644 --- a/pkg/cluster/internal/create/actions/cluster/cluster.go +++ b/pkg/cluster/internal/create/actions/cluster/cluster.go @@ -37,7 +37,7 @@ type K8sObject struct { Spec DescriptorFile `yaml:"spec" validate:"required,dive"` } -// DescriptorFile represents the YAML structure in the descriptor file +// DescriptorFile represents the YAML structure in the spec field of the descriptor file type DescriptorFile struct { ClusterID string `yaml:"cluster_id" validate:"required,min=3,max=100"` DeployAutoscaler bool `yaml:"deploy_autoscaler" validate:"boolean"` @@ -48,10 +48,9 @@ type DescriptorFile struct { InfraProvider string `yaml:"infra_provider" validate:"required,oneof='aws' 'gcp' 'azure'"` - K8SVersion string `yaml:"k8s_version" validate:"required,startswith=v,min=7,max=8"` - Region string `yaml:"region" validate:"required"` - SSHKey string `yaml:"ssh_key"` - FullyPrivate bool `yaml:"fully_private" validate:"boolean"` + K8SVersion string `yaml:"k8s_version" validate:"required,startswith=v,min=7,max=8"` + Region string `yaml:"region" validate:"required"` + SSHKey string `yaml:"ssh_key"` Networks Networks `yaml:"networks"` @@ -72,10 +71,9 @@ type DescriptorFile struct { ControlPlane struct { Managed bool `yaml:"managed" validate:"boolean"` Name string `yaml:"name"` - AmiID string `yaml:"ami_id"` + NodeImage string `yaml:"node_image" validate:"required"` HighlyAvailable bool `yaml:"highly_available" validate:"boolean"` Size string `yaml:"size" validate:"required_if=Managed false"` - Image string `yaml:"image" validate:"required_if=InfraProvider gcp"` RootVolume struct { Size int `yaml:"size" validate:"numeric"` Type string `yaml:"type"` @@ -121,10 +119,9 @@ type AWS struct { type WorkerNodes []struct { Name string `yaml:"name" validate:"required"` - AmiID string `yaml:"ami_id"` + NodeImage string `yaml:"node_image" validate:"required"` Quantity int `yaml:"quantity" validate:"required,numeric,gt=0"` Size string `yaml:"size" validate:"required"` - Image string `yaml:"image" validate:"required_if=InfraProvider gcp"` ZoneDistribution string `yaml:"zone_distribution" validate:"omitempty,oneof='balanced' 'unbalanced'"` AZ string `yaml:"az"` SSHKey string `yaml:"ssh_key"` @@ -142,7 +139,7 @@ type WorkerNodes []struct { // Bastion represents the bastion VM type Bastion struct { - AmiID string `yaml:"ami_id"` + node_image string `yaml:"node_image"` VMSize string `yaml:"vm_size"` AllowedCIDRBlocks []string `yaml:"allowedCIDRBlocks"` } @@ -206,7 +203,6 @@ type TemplateParams struct { // Init sets default values for the DescriptorFile func (d DescriptorFile) Init() DescriptorFile { - d.FullyPrivate = false d.ControlPlane.HighlyAvailable = true // Autoscaler diff --git a/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl b/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl index 0cec6e6789..6389c04193 100644 --- a/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl +++ b/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl @@ -142,9 +142,9 @@ spec: spotMarketOptions: maxPrice: \"\" {{- end }} - {{- if ne $node.AmiID "" }} + {{- if ne $node.NodeImage "" }} ami: - id: {{ $node.AmiID }} + id: {{ $node.NodeImage }} {{- end }} iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" instanceType: "{{ $node.Size }}" diff --git a/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl b/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl index 0101500b05..b239424dc1 100644 --- a/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl +++ b/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl @@ -207,7 +207,7 @@ spec: template: spec: instanceType: "{{ $node.Size }}" - image: "{{ $node.Image }}" + image: "{{ $node.NodeImage }}" {{- if $node.RootVolume.Size }} rootDeviceSize: {{ $node.RootVolume.Size }} {{- end }} diff --git a/pkg/cluster/internal/create/actions/createworker/keosinstaller.go b/pkg/cluster/internal/create/actions/createworker/keosinstaller.go index cdf2a1e29c..894c965a33 100644 --- a/pkg/cluster/internal/create/actions/createworker/keosinstaller.go +++ b/pkg/cluster/internal/create/actions/createworker/keosinstaller.go @@ -106,8 +106,8 @@ func createKEOSDescriptor(descriptorFile cluster.DescriptorFile, storageClass st keosDescriptor.Keos.Storage.Providers = []string{"custom"} // Keos - External dns - if !descriptorFile.Dns.HostedZones { - keosDescriptor.Keos.Dns.ExternalDns.Enabled = &descriptorFile.Dns.HostedZones + if !descriptorFile.Dns.ManageZone { + keosDescriptor.Keos.Dns.ExternalDns.Enabled = &descriptorFile.Dns.ManageZone } keosYAMLData, err := yaml.Marshal(keosDescriptor) From 373a26c36c5d0c7a5f039a144608adc82cb3aaef Mon Sep 17 00:00:00 2001 From: Santiago Sanchez Paz Date: Mon, 27 Mar 2023 18:13:36 +0200 Subject: [PATCH 03/20] fix zones --- pkg/cluster/internal/create/actions/cluster/cluster.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/internal/create/actions/cluster/cluster.go b/pkg/cluster/internal/create/actions/cluster/cluster.go index 0d9468c797..873f2b3cf4 100644 --- a/pkg/cluster/internal/create/actions/cluster/cluster.go +++ b/pkg/cluster/internal/create/actions/cluster/cluster.go @@ -55,7 +55,7 @@ type DescriptorFile struct { Networks Networks `yaml:"networks"` Dns struct { - HostedZones bool `yaml:"hosted_zones" validate:"boolean"` + ManageZone bool `yaml:"manage_zone" validate:"boolean"` } `yaml:"dns"` DockerRegistries []DockerRegistry `yaml:"docker_registries" validate:"dive"` @@ -216,8 +216,8 @@ func (d DescriptorFile) Init() DescriptorFile { d.ControlPlane.AWS.Logging.ControllerManager = false d.ControlPlane.AWS.Logging.Scheduler = false - // Hosted zones - d.Dns.HostedZones = true + // Managed zones + d.Dns.ManageZone = true return d } From 2a4107b6e54a1087c5f5b9f1b6f5ac67e58115f9 Mon Sep 17 00:00:00 2001 From: Santiago Sanchez Paz Date: Mon, 27 Mar 2023 18:17:40 +0200 Subject: [PATCH 04/20] bastion ssh_key --- pkg/cluster/internal/create/actions/cluster/cluster.go | 2 +- .../internal/create/actions/cluster/templates/aws.eks.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/internal/create/actions/cluster/cluster.go b/pkg/cluster/internal/create/actions/cluster/cluster.go index 873f2b3cf4..5090757646 100644 --- a/pkg/cluster/internal/create/actions/cluster/cluster.go +++ b/pkg/cluster/internal/create/actions/cluster/cluster.go @@ -50,7 +50,6 @@ type DescriptorFile struct { K8SVersion string `yaml:"k8s_version" validate:"required,startswith=v,min=7,max=8"` Region string `yaml:"region" validate:"required"` - SSHKey string `yaml:"ssh_key"` Networks Networks `yaml:"networks"` @@ -142,6 +141,7 @@ type Bastion struct { node_image string `yaml:"node_image"` VMSize string `yaml:"vm_size"` AllowedCIDRBlocks []string `yaml:"allowedCIDRBlocks"` + SSHKey string `yaml:"ssh_key"` } type Node struct { diff --git a/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl b/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl index 6389c04193..1dedb42050 100644 --- a/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl +++ b/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl @@ -88,7 +88,7 @@ spec: {{- end }} {{- end }} region: "{{ .Descriptor.Region }}" - sshKeyName: \"{{ .Descriptor.SSHKey }}\" + sshKeyName: \"{{ .Descriptor.Bastion.SSHKey }}\" version: "{{ .Descriptor.K8SVersion }}" vpcCni: env: From b3d0f24ffd08c95243d9946c0ae440331bb0b53c Mon Sep 17 00:00:00 2001 From: lreciomelero Date: Tue, 28 Mar 2023 12:08:23 +0200 Subject: [PATCH 05/20] fixed PR --- pkg/cluster/internal/create/actions/cluster/cluster.go | 2 +- pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/internal/create/actions/cluster/cluster.go b/pkg/cluster/internal/create/actions/cluster/cluster.go index 5090757646..960685fb7b 100644 --- a/pkg/cluster/internal/create/actions/cluster/cluster.go +++ b/pkg/cluster/internal/create/actions/cluster/cluster.go @@ -138,7 +138,7 @@ type WorkerNodes []struct { // Bastion represents the bastion VM type Bastion struct { - node_image string `yaml:"node_image"` + NodeImage string `yaml:"node_image"` VMSize string `yaml:"vm_size"` AllowedCIDRBlocks []string `yaml:"allowedCIDRBlocks"` SSHKey string `yaml:"ssh_key"` diff --git a/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl b/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl index b239424dc1..26a0d3eea3 100644 --- a/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl +++ b/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl @@ -145,7 +145,7 @@ spec: template: spec: instanceType: "{{ .Descriptor.ControlPlane.Size }}" - image: "{{ .Descriptor.ControlPlane.Image }}" + image: "{{ .Descriptor.ControlPlane.NodeImage }}" {{- if .Descriptor.ControlPlane.RootVolume.Size }} rootDeviceSize: {{ .Descriptor.ControlPlane.RootVolume.Size }} {{- end }} From 18fe485f74407a59d1f1ca510b04e83a752a3dc8 Mon Sep 17 00:00:00 2001 From: Santiago Sanchez Paz Date: Tue, 28 Mar 2023 22:24:46 +0200 Subject: [PATCH 06/20] fix/node_image required condition --- pkg/cluster/internal/create/actions/cluster/cluster.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/internal/create/actions/cluster/cluster.go b/pkg/cluster/internal/create/actions/cluster/cluster.go index 960685fb7b..e78d2bd817 100644 --- a/pkg/cluster/internal/create/actions/cluster/cluster.go +++ b/pkg/cluster/internal/create/actions/cluster/cluster.go @@ -70,7 +70,7 @@ type DescriptorFile struct { ControlPlane struct { Managed bool `yaml:"managed" validate:"boolean"` Name string `yaml:"name"` - NodeImage string `yaml:"node_image" validate:"required"` + NodeImage string `yaml:"node_image" validate:"required_if=InfraProvider gcp"` HighlyAvailable bool `yaml:"highly_available" validate:"boolean"` Size string `yaml:"size" validate:"required_if=Managed false"` RootVolume struct { @@ -118,7 +118,7 @@ type AWS struct { type WorkerNodes []struct { Name string `yaml:"name" validate:"required"` - NodeImage string `yaml:"node_image" validate:"required"` + NodeImage string `yaml:"node_image" validate:"required_if=InfraProvider gcp"` Quantity int `yaml:"quantity" validate:"required,numeric,gt=0"` Size string `yaml:"size" validate:"required"` ZoneDistribution string `yaml:"zone_distribution" validate:"omitempty,oneof='balanced' 'unbalanced'"` From 626d833db294d61574acc5f43a3f454f60f3fd74 Mon Sep 17 00:00:00 2001 From: Francisco Augusto Date: Thu, 30 Mar 2023 11:27:03 +0200 Subject: [PATCH 07/20] Add retries retrieving kubeconfig --- .../actions/createworker/createworker.go | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/pkg/cluster/internal/create/actions/createworker/createworker.go b/pkg/cluster/internal/create/actions/createworker/createworker.go index 5c9df7b9fa..5ac8fd67b2 100644 --- a/pkg/cluster/internal/create/actions/createworker/createworker.go +++ b/pkg/cluster/internal/create/actions/createworker/createworker.go @@ -22,6 +22,7 @@ import ( _ "embed" "os" "strings" + "time" "sigs.k8s.io/kind/pkg/cluster/internal/create/actions" "sigs.k8s.io/kind/pkg/cluster/internal/create/actions/cluster" @@ -253,19 +254,28 @@ func (a *action) Execute(ctx *actions.ActionContext) error { return errors.Wrap(err, "failed to create the worker Cluster") } - // Get the workload cluster kubeconfig - raw = bytes.Buffer{} - cmd = node.Command("sh", "-c", "clusterctl -n "+capiClustersNamespace+" get kubeconfig "+descriptorFile.ClusterID+" | tee "+kubeconfigPath) - if err := cmd.SetStdout(&raw).Run(); err != nil { - return errors.Wrap(err, "failed to get workload cluster kubeconfig") - } - kubeconfig := raw.String() - ctx.Status.End(true) // End Creating the workload cluster ctx.Status.Start("Saving the workload cluster kubeconfig 📝") defer ctx.Status.End(false) + // Get the workload cluster kubeconfig + cmd = node.Command("sh", "-c", "clusterctl -n "+capiClustersNamespace+" get kubeconfig "+descriptorFile.ClusterID+" | tee "+kubeconfigPath) + for i := 0; i < 3; i++ { + raw = bytes.Buffer{} + if err := cmd.SetStdout(&raw).SetStderr(&raw).Run(); err != nil { + return errors.Wrap(err, "failed to get workload cluster kubeconfig") + } + if !strings.Contains(raw.String(), "Error:") && raw.String() != "" { + continue + } + if i == 2 { + return errors.New(raw.String() + " failed to get workload cluster kubeconfig") + } + time.Sleep(3 * time.Second) + } + kubeconfig := raw.String() + workKubeconfigBasePath := strings.Split(workKubeconfigPath, "/")[0] _, err = os.Stat(workKubeconfigBasePath) if err != nil { From 653cbaaeb3ab26ec7674f5279ff4421e3e0e86e0 Mon Sep 17 00:00:00 2001 From: Francisco Augusto Date: Thu, 30 Mar 2023 13:06:42 +0200 Subject: [PATCH 08/20] Add new control plane wait condition --- .../actions/createworker/createworker.go | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/pkg/cluster/internal/create/actions/createworker/createworker.go b/pkg/cluster/internal/create/actions/createworker/createworker.go index 5ac8fd67b2..b39d5f3367 100644 --- a/pkg/cluster/internal/create/actions/createworker/createworker.go +++ b/pkg/cluster/internal/create/actions/createworker/createworker.go @@ -22,7 +22,6 @@ import ( _ "embed" "os" "strings" - "time" "sigs.k8s.io/kind/pkg/cluster/internal/create/actions" "sigs.k8s.io/kind/pkg/cluster/internal/create/actions/cluster" @@ -254,25 +253,23 @@ func (a *action) Execute(ctx *actions.ActionContext) error { return errors.Wrap(err, "failed to create the worker Cluster") } + // Wait for the control plane initialization + raw = bytes.Buffer{} + cmd = node.Command("kubectl", "-n", capiClustersNamespace, "wait", "--for=condition=ControlPlaneInitialized", "--timeout", "5m", "cluster", descriptorFile.ClusterID) + if err := cmd.SetStdout(&raw).Run(); err != nil { + return errors.Wrap(err, "failed to create the worker Cluster") + } + ctx.Status.End(true) // End Creating the workload cluster ctx.Status.Start("Saving the workload cluster kubeconfig 📝") defer ctx.Status.End(false) // Get the workload cluster kubeconfig + raw = bytes.Buffer{} cmd = node.Command("sh", "-c", "clusterctl -n "+capiClustersNamespace+" get kubeconfig "+descriptorFile.ClusterID+" | tee "+kubeconfigPath) - for i := 0; i < 3; i++ { - raw = bytes.Buffer{} - if err := cmd.SetStdout(&raw).SetStderr(&raw).Run(); err != nil { - return errors.Wrap(err, "failed to get workload cluster kubeconfig") - } - if !strings.Contains(raw.String(), "Error:") && raw.String() != "" { - continue - } - if i == 2 { - return errors.New(raw.String() + " failed to get workload cluster kubeconfig") - } - time.Sleep(3 * time.Second) + if err := cmd.SetStdout(&raw).SetStderr(&raw).Run(); err != nil || strings.Contains(raw.String(), "Error:") || raw.String() == "" { + return errors.Wrap(err, "failed to get workload cluster kubeconfig") } kubeconfig := raw.String() From 1bb9d3127d5d40a719ea03a2e16a92ea4e50a3a3 Mon Sep 17 00:00:00 2001 From: stratiocommit Date: Thu, 30 Mar 2023 18:39:38 +0000 Subject: [PATCH 09/20] [BUILD] 0.17.0-0.1.0: New pre-release --- CHANGELOG.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63cdbb5722..8fa7124ba3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.17.0-0.1.0 (2023-03-26) +## 0.17.0-0.1.0 (2023-03-30) * Add clusterAPI capabilities for EKS diff --git a/VERSION b/VERSION index b694fe3f6c..7896075657 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0-SNAPSHOT +0.1.0-BUILD From b01acec2d6b26cf4a47556497360e18e6d4568c9 Mon Sep 17 00:00:00 2001 From: stratiocommit Date: Thu, 30 Mar 2023 18:40:58 +0000 Subject: [PATCH 10/20] Prepare for next version: 0.17.0-0.1.0-SNAPSHOT --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7896075657..b694fe3f6c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0-BUILD +0.1.0-SNAPSHOT From 66418aa965abf616485b8200cab04426e488af6b Mon Sep 17 00:00:00 2001 From: Santiago Sanchez Paz Date: Fri, 31 Mar 2023 15:09:17 +0200 Subject: [PATCH 11/20] Bump to CAPA release --- pkg/cluster/internal/create/actions/createworker/aws.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/internal/create/actions/createworker/aws.go b/pkg/cluster/internal/create/actions/createworker/aws.go index f8bafab5e6..97140d0073 100644 --- a/pkg/cluster/internal/create/actions/createworker/aws.go +++ b/pkg/cluster/internal/create/actions/createworker/aws.go @@ -42,7 +42,7 @@ func newAWSBuilder() *AWSBuilder { func (b *AWSBuilder) setCapx(managed bool) { b.capxProvider = "aws" b.capxVersion = "v2.0.2" - b.capxImageVersion = "2.0.2-0.1.0-abc39a5" + b.capxImageVersion = "2.0.2-0.1.0" b.capxName = "capa" b.stClassName = "gp2" if managed { From d685500f87d4d8e93854077805dc4e37e98d19a8 Mon Sep 17 00:00:00 2001 From: stratiocommit Date: Fri, 31 Mar 2023 15:50:35 +0000 Subject: [PATCH 12/20] [BUILD] 0.17.0-0.1.0: New pre-release --- CHANGELOG.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fa7124ba3..0b59c51710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.17.0-0.1.0 (2023-03-30) +## 0.17.0-0.1.0 (2023-03-31) * Add clusterAPI capabilities for EKS diff --git a/VERSION b/VERSION index b694fe3f6c..7896075657 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0-SNAPSHOT +0.1.0-BUILD From 74615412eb66ab8bb099f347af69124414f30541 Mon Sep 17 00:00:00 2001 From: lreciomelero Date: Tue, 4 Apr 2023 17:20:10 +0200 Subject: [PATCH 13/20] aligning branch-0.17.0-0.1 cicd with branch-0.17.0-0.2 --- .gitignore | 4 +++- Jenkinsfile | 3 ++- Makefile | 10 ++++------ {hack/custom => bin}/change-version.sh | 2 +- {hack/custom => bin}/deploy.sh | 11 +++++------ bin/package.sh | 14 ++++++++++++++ 6 files changed, 29 insertions(+), 15 deletions(-) rename {hack/custom => bin}/change-version.sh (87%) rename {hack/custom => bin}/deploy.sh (57%) create mode 100755 bin/package.sh diff --git a/.gitignore b/.gitignore index a470e245f5..44444c9d60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # build and test outputs -/bin/ /_output/ /_artifacts/ @@ -21,7 +20,10 @@ *.sublime-workspace *~ +/bin/.gimme +/bin/cloud-provisioner* deploy-recorder.lst /hack/go /hack/pkg /hack/*.tar.gz +deploy-recorder.lst \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index dbed6c1580..a35ef94540 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,9 +10,10 @@ hose { UPSTREAM_VERSION = '0.17.0' DEPLOYONPRS = true GRYPE_TEST = false + MODULE_LIST = [ "paas.cloud-provisioner:cloud-provisioner:tar.gz"] DEV = { config -> doPackage(conf: config, parameters: "GOCACHE=/tmp") - doDeploy(conf:config) + doDeploy(conf: config) } } \ No newline at end of file diff --git a/Makefile b/Makefile index f2e162dc33..369ae056f4 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ test: # ================================= Cleanup ==================================== # standard cleanup target clean: - rm -rf "$(OUT_DIR)/" + find $(OUT_DIR)/ -name 'cloud-provisioner*' -delete && rm -rf "$(OUT_DIR)/.gimme" ################################################################################ # ============================== Auto-Update =================================== # update generated code, gofmt, etc. @@ -111,16 +111,14 @@ lint: shellcheck: hack/make-rules/verify/shellcheck.sh - - package: - go build -v -o "$(OUT_DIR)/$(KIND_BINARY_NAME)" $(KIND_BUILD_FLAGS) + make build && bin/package.sh $(version) deploy: - hack/custom/deploy.sh + bin/deploy.sh $(version) change-version: - hack/custom/change-version.sh $(version) + bin/change-version.sh $(version) ################################################################################# .PHONY: all kind build install unit clean update generate gofmt verify lint shellcheck \ No newline at end of file diff --git a/hack/custom/change-version.sh b/bin/change-version.sh similarity index 87% rename from hack/custom/change-version.sh rename to bin/change-version.sh index 041e1e6dc1..ceeb23a468 100755 --- a/hack/custom/change-version.sh +++ b/bin/change-version.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -BASEDIR=`dirname $0`/../.. +BASEDIR=`dirname $0`/.. cd $BASEDIR diff --git a/hack/custom/deploy.sh b/bin/deploy.sh similarity index 57% rename from hack/custom/deploy.sh rename to bin/deploy.sh index 620069f0ea..411385abd5 100755 --- a/hack/custom/deploy.sh +++ b/bin/deploy.sh @@ -2,18 +2,17 @@ DIR=bin BASEDIR=`dirname $0`/../.. -VERSION=`cat $BASEDIR/VERSION` +VERSION=$1 EXTENSION="tar.gz" GROUP_ID="repository.paas.cloud-provisioner" GROUP_ID_NEXUS=${GROUP_ID//.//} +FILE="$DIR"/cloud-provisioner-${VERSION}.${EXTENSION} - -if [ -d "$DIR" ] || [ -r "$DIR"/cloud-provisioner]; then +if [ -d "$DIR" ] || [ -r "$FILE" ]; then echo "Uploading cloud-provisioner-$VERSION..." - tar czf "$DIR"/cloud-provisioner-${VERSION}.${EXTENSION} "$DIR"/cloud-provisioner curl -sS -u stratio:${NEXUSPASS} --upload-file "$DIR"/cloud-provisioner-${VERSION}.${EXTENSION} http://qa.int.stratio.com/${GROUP_ID_NEXUS}/ - echo "$GROUP_ID:cloud-provisioner:$EXTENSION" >> "$BASEDIR/deploy-recorder.lst" - rm -rf $BASEDIR/hack/go + echo "$GROUP_ID:cloud-provisioner:$EXTENSION" >> "$BASEDIR/deploy-recorder.lst" + rm -rf $BASEDIR/hack/go else echo "Run 'make build' first" exit 1 diff --git a/bin/package.sh b/bin/package.sh new file mode 100755 index 0000000000..c7de5e2f52 --- /dev/null +++ b/bin/package.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +DIR=bin +BASEDIR=`dirname $0`/../.. +VERSION=$1 +EXTENSION="tar.gz" + +if [ -d "$DIR" ] || [ -r "$DIR"/cloud-provisioner]; then + echo "Packaging cloud-provisioner-$VERSION..." + tar czf "$DIR"/cloud-provisioner-${VERSION}.${EXTENSION} "$DIR"/cloud-provisioner +else + echo "Run 'make build' first" + exit 1 +fi \ No newline at end of file From 314132b5791ae264abf7e85f9bc9a431211e3511 Mon Sep 17 00:00:00 2001 From: Francisco Augusto Date: Tue, 11 Apr 2023 12:53:46 +0200 Subject: [PATCH 14/20] Fix deploy_tigera_operator in keos.yaml --- .../internal/create/actions/createworker/keosinstaller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/internal/create/actions/createworker/keosinstaller.go b/pkg/cluster/internal/create/actions/createworker/keosinstaller.go index cdf2a1e29c..8b431f2efe 100644 --- a/pkg/cluster/internal/create/actions/createworker/keosinstaller.go +++ b/pkg/cluster/internal/create/actions/createworker/keosinstaller.go @@ -39,10 +39,10 @@ type KEOSDescriptor struct { } `yaml:"gcp,omitempty"` Keos struct { Calico struct { - Ipip bool `yaml:"ipip"` - Pool string `yaml:"pool"` + Ipip bool `yaml:"ipip,omitempty"` + Pool string `yaml:"pool,omitempty"` DeployTigeraOperator bool `yaml:"deploy_tigera_operator"` - } `yaml:"calico,omitempty"` + } `yaml:"calico"` ClusterID string `yaml:"cluster_id"` Dns struct { ExternalDns struct { From e006c35a16acbcdeb6cbed6d76e96f8d9ed643d8 Mon Sep 17 00:00:00 2001 From: esierra-stratio Date: Tue, 11 Apr 2023 17:01:34 +0200 Subject: [PATCH 15/20] chore: handle keos domain parameter --- pkg/cluster/internal/create/actions/cluster/cluster.go | 3 ++- .../create/actions/createworker/keosinstaller.go | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/internal/create/actions/cluster/cluster.go b/pkg/cluster/internal/create/actions/cluster/cluster.go index 394b398bc0..d2a06ebdad 100644 --- a/pkg/cluster/internal/create/actions/cluster/cluster.go +++ b/pkg/cluster/internal/create/actions/cluster/cluster.go @@ -64,7 +64,8 @@ type DescriptorFile struct { ExternalDomain string `yaml:"external_domain" validate:"omitempty,hostname"` Keos struct { - Domain string `yaml:"domain" validate:"required,hostname"` + // PR fixing exclude_if behaviour https://github.com/go-playground/validator/pull/939 + Domain string `yaml:"domain" validate:"omitempty,hostname"` Flavour string `yaml:"flavour"` Version string `yaml:"version"` } `yaml:"keos"` diff --git a/pkg/cluster/internal/create/actions/createworker/keosinstaller.go b/pkg/cluster/internal/create/actions/createworker/keosinstaller.go index cdf2a1e29c..fa2e5f4a39 100644 --- a/pkg/cluster/internal/create/actions/createworker/keosinstaller.go +++ b/pkg/cluster/internal/create/actions/createworker/keosinstaller.go @@ -49,7 +49,8 @@ type KEOSDescriptor struct { Enabled *bool `yaml:"enabled,omitempty"` } `yaml:"external_dns,omitempty"` } `yaml:"dns,omitempty"` - Domain string `yaml:"domain"` + // PR fixing exclude_if behaviour https://github.com/go-playground/validator/pull/939 + Domain string `yaml:"domain,omitempty"` ExternalDomain string `yaml:"external_domain,omitempty"` Flavour string `yaml:"flavour"` K8sInstallation bool `yaml:"k8s_installation"` @@ -88,7 +89,11 @@ func createKEOSDescriptor(descriptorFile cluster.DescriptorFile, storageClass st // Keos keosDescriptor.Keos.ClusterID = descriptorFile.ClusterID - keosDescriptor.Keos.Domain = descriptorFile.Keos.Domain + if descriptorFile.InfraProvider == "aws" { + keosDescriptor.Keos.Domain = "cluster.local" + } else if descriptorFile.Keos.Domain != "" { + keosDescriptor.Keos.Domain = descriptorFile.Keos.Domain + } if descriptorFile.ExternalDomain != "" { keosDescriptor.Keos.ExternalDomain = descriptorFile.ExternalDomain } From 2662dca41ef88088809bf9adc633a6e1846f5f87 Mon Sep 17 00:00:00 2001 From: iamjanr Date: Thu, 13 Apr 2023 16:17:48 +0200 Subject: [PATCH 16/20] Versions Upgrade --- DEPENDENCIES | 32 +++++++++---------- pkg/apis/config/defaults/image.go | 4 +-- .../actions/cluster/templates/aws.eks.tmpl | 4 +-- ...cp-compute-persistent-disk-csi-driver.yaml | 18 +++++------ .../create/actions/createworker/gcp.go | 4 +-- .../create/actions/createworker/provider.go | 6 ++-- .../templates/calico-helm-values.tmpl | 2 +- .../providers/docker/stratio/Dockerfile | 10 +++--- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index 60ecda5c38..6c8bc2e55c 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,25 +1,25 @@ core: kind: - clusterctl: v1.3.2 - cluster-api: v1.3.2 - capi-kubeadm-bootstrap-system: v1.3.2 - capi-kubeadm-control-plane-system: v1.3.2 + clusterctl: v1.4.1 + cluster-api: v1.4.1 + capi-kubeadm-bootstrap-system: v1.4.1 + capi-kubeadm-control-plane-system: v1.4.1 calico: - calicoctl: v3.22.3 + calicoctl: v3.25.1 tigera-operator: v1.25.9 - cluster-autoscaler: 9.25.0 + cluster-autoscaler: 9.28.0 aws: clusterawsadm: v2.0.2 cluster-api-aws: v2.0.2 cluster-api-aws-templates: v2.0.2 - aws-ebs-csi-driver: v1.14.1-eksbuild.1 - vpc-cni: v1.12.1-eksbuild.1 + aws-ebs-csi-driver: v1.17.0-eksbuild.1 + vpc-cni: v1.12.6-eksbuild.1 gcp: - cluster-api-gcp: v1.2.1 - cluster-api-gcp-templates: v1.2.1 - gcp-compute-persistent-disk-csi-driver: v1.7.1 - csi-node-driver-registrar: v2.5.0 - csi-snapshotter: v4.0.1 - csi-resizer: v1.4.0 - csi-attacher: v3.4.0 - csi-provisioner: v3.1.0 + cluster-api-gcp: v1.3.0 + cluster-api-gcp-templates: v1.3.0 + gcp-compute-persistent-disk-csi-driver: v1.9.2 + csi-node-driver-registrar: v2.6.3 + csi-snapshotter: v6.2.1 + csi-resizer: v1.7.0 + csi-attacher: v4.2.0 + csi-provisioner: v3.4.1 diff --git a/pkg/apis/config/defaults/image.go b/pkg/apis/config/defaults/image.go index 65bc5edb21..5367245fab 100644 --- a/pkg/apis/config/defaults/image.go +++ b/pkg/apis/config/defaults/image.go @@ -18,7 +18,7 @@ limitations under the License. package defaults // Image is the default for the Config.Image field, aka the default node image. -const Image = "kindest/node:v1.24.7@sha256:5c015142d9b60a0f6c45573f809957076514e38ec973565e2b2fe828b91597f5" +const Image = "kindest/node:v1.27.0@sha256:bac1b0e00322ba0269a5811fb574dab91f93176d9f00cec3b3eb0832beb1ce84" // StratioImage is the extended Image for Stratio KEOS -const StratioImage = "stratio-capi:v1.24.7" +const StratioImage = "stratio-capi:v1.27.0" diff --git a/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl b/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl index c0dfbe1d49..68eec1d7a6 100644 --- a/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl +++ b/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl @@ -32,9 +32,9 @@ metadata: spec: addons: - name: "aws-ebs-csi-driver" - version: "v1.14.1-eksbuild.1" + version: "v1.17.0-eksbuild.1" - name: "vpc-cni" - version: "v1.12.1-eksbuild.1" + version: "v1.12.6-eksbuild.1" conflictResolution: "overwrite" associateOIDCProvider: {{ .Descriptor.ControlPlane.AWS.AssociateOIDCProvider }} eksClusterName: "{{ .Descriptor.ClusterID }}" diff --git a/pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml b/pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml index 884648e693..4911dbe35e 100644 --- a/pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml +++ b/pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml @@ -541,7 +541,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: k8s.gcr.io/sig-storage/csi-provisioner:v3.1.0 + image: k8s.gcr.io/sig-storage/csi-provisioner:v3.4.1 livenessProbe: failureThreshold: 1 httpGet: @@ -570,7 +570,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: k8s.gcr.io/sig-storage/csi-attacher:v3.4.0 + image: k8s.gcr.io/sig-storage/csi-attacher:v4.2.0 livenessProbe: failureThreshold: 1 httpGet: @@ -599,7 +599,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: k8s.gcr.io/sig-storage/csi-resizer:v1.4.0 + image: k8s.gcr.io/sig-storage/csi-resizer:v1.7.0 livenessProbe: failureThreshold: 1 httpGet: @@ -628,7 +628,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: k8s.gcr.io/sig-storage/csi-snapshotter:v4.0.1 + image: k8s.gcr.io/sig-storage/csi-snapshotter:v6.2.1 name: csi-snapshotter volumeMounts: - mountPath: /csi @@ -639,7 +639,7 @@ spec: env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/cloud-sa/cloud-sa.json - image: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.7.1 + image: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.9.2 name: gce-pd-driver volumeMounts: - mountPath: /csi @@ -683,7 +683,7 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName - image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.5.0 + image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.6.3 name: csi-driver-registrar volumeMounts: - mountPath: /csi @@ -694,7 +694,7 @@ spec: - --v=5 - --endpoint=unix:/csi/csi.sock - --run-controller-service=false - image: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.7.1 + image: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.9.2 name: gce-pd-driver securityContext: privileged: true @@ -779,7 +779,7 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName - image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.5.0 + image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.6.3 name: csi-driver-registrar volumeMounts: - mountPath: /csi @@ -790,7 +790,7 @@ spec: - --v=5 - --endpoint=unix:/csi/csi.sock - --run-controller-service=false - image: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.7.1 + image: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.9.2 name: gce-pd-driver volumeMounts: - mountPath: C:\var\lib\kubelet diff --git a/pkg/cluster/internal/create/actions/createworker/gcp.go b/pkg/cluster/internal/create/actions/createworker/gcp.go index d3c2fad545..22eeea9078 100644 --- a/pkg/cluster/internal/create/actions/createworker/gcp.go +++ b/pkg/cluster/internal/create/actions/createworker/gcp.go @@ -53,8 +53,8 @@ func newGCPBuilder() *GCPBuilder { func (b *GCPBuilder) setCapx(managed bool) { b.capxProvider = "gcp" - b.capxVersion = "v1.2.1" - b.capxImageVersion = "v1.2.1" + b.capxVersion = "v1.3.0" + b.capxImageVersion = "v1.3.0" b.capxName = "capg" b.stClassName = "csi-gcp-pd" if managed { diff --git a/pkg/cluster/internal/create/actions/createworker/provider.go b/pkg/cluster/internal/create/actions/createworker/provider.go index 6b0406f46b..2d785d7dd5 100644 --- a/pkg/cluster/internal/create/actions/createworker/provider.go +++ b/pkg/cluster/internal/create/actions/createworker/provider.go @@ -26,9 +26,9 @@ import ( ) const ( - CAPICoreProvider = "cluster-api:v1.3.2" - CAPIBootstrapProvider = "kubeadm:v1.3.2" - CAPIControlPlaneProvider = "kubeadm:v1.3.2" + CAPICoreProvider = "cluster-api:v1.4.1" + CAPIBootstrapProvider = "kubeadm:v1.4.1" + CAPIControlPlaneProvider = "kubeadm:v1.4.1" //CAPILocalRepository = "/root/.cluster-api/local-repository" CalicoName = "calico" diff --git a/pkg/cluster/internal/create/actions/createworker/templates/calico-helm-values.tmpl b/pkg/cluster/internal/create/actions/createworker/templates/calico-helm-values.tmpl index 04201354ca..4f57052286 100644 --- a/pkg/cluster/internal/create/actions/createworker/templates/calico-helm-values.tmpl +++ b/pkg/cluster/internal/create/actions/createworker/templates/calico-helm-values.tmpl @@ -3,7 +3,7 @@ apiServer: enabled: false calicoctl: image: docker.io/calico/ctl - tag: v3.22.3 + tag: v3.25.1 certs: node: cert: diff --git a/pkg/cluster/internal/providers/docker/stratio/Dockerfile b/pkg/cluster/internal/providers/docker/stratio/Dockerfile index 0c18680898..c20ac8a1df 100644 --- a/pkg/cluster/internal/providers/docker/stratio/Dockerfile +++ b/pkg/cluster/internal/providers/docker/stratio/Dockerfile @@ -1,16 +1,16 @@ -FROM kindest/node:v1.24.7 +FROM kindest/node:v1.27.0 # Init feature gates ENV CLUSTER_TOPOLOGY=true # Tools versions -ENV CLUSTERCTL=v1.3.2 +ENV CLUSTERCTL=v1.4.1 ENV CLUSTERAWSADM=v2.0.2 -ENV HELM_VERSION=v3.11.0 +ENV HELM_VERSION=v3.11.3 # Helm charts -ENV CLUSTER_AUTOSCALER=9.25.0 -ENV TIGERA_OPERATOR=v3.22.3 +ENV CLUSTER_AUTOSCALER=9.28.0 +ENV TIGERA_OPERATOR=v3.25.1 # Cluster-api artifacts ENV CAPI_REPO=/root/.cluster-api/local-repository From 8516c65648c3ac131ed51596059e3c838e7ae6c1 Mon Sep 17 00:00:00 2001 From: iamjanr Date: Thu, 13 Apr 2023 16:23:38 +0200 Subject: [PATCH 17/20] Add docs Folder --- docs/cloud-provisioner/Versiones.md | 153 ++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 docs/cloud-provisioner/Versiones.md diff --git a/docs/cloud-provisioner/Versiones.md b/docs/cloud-provisioner/Versiones.md new file mode 100644 index 0000000000..dce06544ff --- /dev/null +++ b/docs/cloud-provisioner/Versiones.md @@ -0,0 +1,153 @@ +# Actualización de versiones + +> [kindest/node](https://hub.docker.com/r/kindest/node/tags) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v1.24.7 | 2022-10-26 | v1.27.0 | 2022-04-11 | + +Files: +* pkg/apis/config/defaults/image.go +* pkg/cluster/internal/providers/docker/stratio/Dockerfile + +> [clusterctl](https://github.com/kubernetes-sigs/cluster-api/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v1.3.2 | 2023-01-10 | v1.4.1 | 2023-04-04 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/providers/docker/stratio/Dockerfile +* pkg/cluster/internal/create/actions/createworker/provider.go + +> [clusterawsadm](https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v2.0.2 | 2022-12-01 | v2.0.2 | 2022-12-01 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/providers/docker/stratio/Dockerfile +* pkg/cluster/internal/create/actions/createworker/aws.go + +> [Helm](https://github.com/helm/helm/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v3.11.0 | 2022-01-18 | v3.11.3 | 2023-04-12 | + +Files: +* pkg/cluster/internal/providers/docker/stratio/Dockerfile + +> [cluster_auto_scaler](https://github.com/kubernetes/autoscaler/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v9.25.0 | 2022-02-21 | v9.28.0 | 2023-04-04 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/providers/docker/stratio/Dockerfile + +> [Tigera_operator](https://github.com/projectcalico/calico/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v3.22.3 | 2022-05-21 | v3.25.1 | 2023-03-31 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/providers/docker/stratio/Dockerfile +* pkg/cluster/internal/create/actions/createworker/templates/calico-helm-values.tmpl + +> [aws-ebs-csi-driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v1.14.1-eksbuild.1 | 2022-01-05 | v1.17.0 | 2023-03-14 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl + +> [vpc-cni](https://github.com/aws/amazon-vpc-cni-k8s/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v1.12.1-eksbuild.1 | 2023-01-05 | v1.12.6-eksbuild.1 | 2023-03-20 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl + +> [cluster-api-gcp / cluster-api-gcp-templates](https://github.com/kubernetes-sigs/cluster-api-provider-gcp/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v1.2.1 | 2022-11-28 | v1.3.0 | 2023-03-17 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/create/actions/createworker/gcp.go + +> [gcp-compute-persistent-disk-csi-driver](https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v1.7.1 | 2022-01-09 | v1.9.2 | 2022-03-17 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml + +> [csi-node-driver-registrar](https://github.com/kubernetes-csi/node-driver-registrar/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v2.5.0 | 2022-02-03 | v2.6.3 | 2023-01-24 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml + +> [csi-snapshotter](https://github.com/kubernetes-csi/external-snapshotter/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v4.0.1 | 2022-02-10 | v6.2.1 | 2023-01-04 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml + +> [csi-resizer](https://github.com/kubernetes-csi/external-resizer/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v1.4.0 | 2022-01-21 | v1.7.0 | 2022-12-28 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml + +> [csi-attacher]() + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v3.4.0 | 2021-12-21 | v4.2.0 | 2023-02-01 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml + +> [csi-provisioner](https://github.com/kubernetes-csi/external-provisioner/releases) + +| Version | Release Date | Latest Version | Latest Release Date | +| ------- | ------------ | -------------- | ------------------- | +| v3.1.0 | 2022-01-12 | v3.4.1 | 2023-04-05 | + +Files: +* DEPENDENCIES +* pkg/cluster/internal/create/actions/createworker/files/gcp-compute-persistent-disk-csi-driver.yaml \ No newline at end of file From 57b47f68522d423d5b05363a8b4769416fdd59c2 Mon Sep 17 00:00:00 2001 From: Francisco Augusto Date: Mon, 17 Apr 2023 14:10:16 +0200 Subject: [PATCH 18/20] Fix gcp containerd config --- .../create/actions/cluster/templates/gcp.tmpl | 50 ++++++++++++------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl b/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl index b2331e773f..2625f8592e 100644 --- a/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl +++ b/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl @@ -36,7 +36,7 @@ spec: region: "{{ $.Descriptor.Region }}" {{- if ne .CidrBlock "" }} cidrBlock: {{ .CidrBlock }} - {{- end }} + {{- end }} {{- end }} {{- end }} {{- else }} @@ -53,7 +53,7 @@ spec: replicas: {{- if .Descriptor.ControlPlane.HighlyAvailable }} 3 {{- else }} 1 {{- end }} machineTemplate: metadata: - labels: + labels: keos.stratio.com/machine-role: "{{ $.Descriptor.ClusterID }}-control-plane-node" infrastructureRef: kind: GCPMachineTemplate @@ -81,21 +81,31 @@ spec: name: gce-conf pathType: FileOrCreate files: - {{- if .DockerRegistries }} + - content: | + [Global] + multizone=true + path: /etc/kubernetes/gce.conf + {{- if gt (len .DockerRegistries) 0 }} - content: | version = 2 imports = [\"/etc/containerd/conf.d/*.toml\"] [plugins] [plugins.\"io.containerd.grpc.v1.cri\"] - sandbox_image = \"k8s.gcr.io/pause:3.6\" + sandbox_image = \"k8s.gcr.io/pause:3.9\" [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc] runtime_type = \"io.containerd.runc.v2\" - [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc.options] - SystemdCgroup = true + [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc.options] + SystemdCgroup = true [plugins.\"io.containerd.grpc.v1.cri\".registry] [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors] [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"docker.io\"] endpoint = [\"https://registry-1.docker.io\"] + {{- range $reg := .DockerRegistries }} + {{- $url := hostname $reg.url }} + [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"{{ $url }}\"] + endpoint = [\"https://{{ $url }}\"] + {{- end }} + [plugins.\"io.containerd.grpc.v1.cri\".registry.configs] {{- range $reg := .DockerRegistries }} {{- $url := hostname $reg.url }} [plugins.\"io.containerd.grpc.v1.cri\".registry.configs.\"{{ $url }}\".auth] @@ -103,11 +113,9 @@ spec: username = \"{{ $reg.user }}\" {{- end }} path: /etc/containerd/config.toml - {{- end }} - - content: | - [Global] - multizone=true - path: /etc/kubernetes/gce.conf + postKubeadmCommands: + - systemctl restart containerd + {{- end }} {{- if .Descriptor.ControlPlane.ExtraVolumes }} diskSetup: filesystems: @@ -182,7 +190,7 @@ spec: matchLabels: template: metadata: - labels: + labels: keos.stratio.com/machine-role: "{{ $.Descriptor.ClusterID }}-worker-node" spec: clusterName: "{{ $.Descriptor.ClusterID }}" @@ -233,22 +241,28 @@ metadata: spec: template: spec: - {{- if $.DockerRegistries }} + {{- if gt (len $.DockerRegistries) 0 }} files: - content: | version = 2 imports = [\"/etc/containerd/conf.d/*.toml\"] [plugins] [plugins.\"io.containerd.grpc.v1.cri\"] - sandbox_image = \"k8s.gcr.io/pause:3.6\" + sandbox_image = \"k8s.gcr.io/pause:3.9\" [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc] runtime_type = \"io.containerd.runc.v2\" - [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc.options] - SystemdCgroup = true + [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc.options] + SystemdCgroup = true [plugins.\"io.containerd.grpc.v1.cri\".registry] [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors] [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"docker.io\"] endpoint = [\"https://registry-1.docker.io\"] + {{- range $reg := $.DockerRegistries }} + {{- $url := hostname $reg.url }} + [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"{{ $url }}\"] + endpoint = [\"https://{{ $url }}\"] + {{- end }} + [plugins.\"io.containerd.grpc.v1.cri\".registry.configs] {{- range $reg := $.DockerRegistries }} {{- $url := hostname $reg.url }} [plugins.\"io.containerd.grpc.v1.cri\".registry.configs.\"{{ $url }}\".auth] @@ -256,7 +270,9 @@ spec: username = \"{{ $reg.user }}\" {{- end }} path: /etc/containerd/config.toml - {{- end }} + postKubeadmCommands: + - systemctl restart containerd + {{- end }} {{- if $node.ExtraVolumes }} diskSetup: filesystems: From 11838cf84d380dcd41b28762296cf37b63c1283d Mon Sep 17 00:00:00 2001 From: Francisco Augusto Date: Mon, 17 Apr 2023 14:16:28 +0200 Subject: [PATCH 19/20] Add pause dependency --- DEPENDENCIES | 1 + 1 file changed, 1 insertion(+) diff --git a/DEPENDENCIES b/DEPENDENCIES index 60ecda5c38..9de4fb025b 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -23,3 +23,4 @@ gcp: csi-resizer: v1.4.0 csi-attacher: v3.4.0 csi-provisioner: v3.1.0 + pause: v3.9 From f2e680d17edcacf7752dd42f33d14532240a2b1a Mon Sep 17 00:00:00 2001 From: Francisco Augusto Date: Fri, 21 Apr 2023 12:01:40 +0200 Subject: [PATCH 20/20] Fix taints conditions --- pkg/cluster/internal/create/actions/cluster/cluster.go | 3 +-- .../create/actions/cluster/templates/aws.eks.tmpl | 10 ++++++---- .../internal/create/actions/cluster/templates/gcp.tmpl | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/cluster/internal/create/actions/cluster/cluster.go b/pkg/cluster/internal/create/actions/cluster/cluster.go index c6e6de5a84..ed142ebdab 100644 --- a/pkg/cluster/internal/create/actions/cluster/cluster.go +++ b/pkg/cluster/internal/create/actions/cluster/cluster.go @@ -302,8 +302,7 @@ func GetClusterManifest(flavor string, params TemplateParams, azs []string) (str return !reflect.ValueOf(v).IsZero() }, "lastElement": func(element int, len int) bool { - element += element - return element == len + return element < len }, } diff --git a/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl b/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl index e35c27cc8f..221d31c501 100644 --- a/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl +++ b/pkg/cluster/internal/create/actions/cluster/templates/aws.eks.tmpl @@ -194,12 +194,14 @@ spec: - {{ $vol.MountPath }} {{- end }} {{- end }} + {{- if or (gt (len $node.Labels) 0) (gt (len $node.Taints) 0) }} kubeletExtraArgs: - {{- if or $node.Labels ( gt (len $node.Taints) 0)}} + {{- if gt (len $node.Labels) 0 }} node-labels: \"{{ range $key, $value := $node.Labels }}{{ $key }}={{ $value }},{{- end }}\" - {{- end }} - {{- if gt (len $node.Taints) 0 }} - register-with-taints: \"{{ range $i, $taint := $node.Taints }}{{$taint.Key}}={{$taint.Value}}:{{$taint.Effect}}{{ $len := len $node.Taints }}{{- if lastElement $i $len }}{{- else }},{{- end }}{{- end }}\" + {{- end }} + {{- if gt (len $node.Taints) 0 }} + register-with-taints: \"{{ range $i, $taint := $node.Taints }}{{ $taint.Key }}={{ $taint.Value }}:{{ $taint.Effect }}{{ $len := len $node.Taints }}{{- if lastElement $i $len }}{{- else }},{{- end }}{{- end }}\" + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl b/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl index 420361e858..a8b4e508ca 100644 --- a/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl +++ b/pkg/cluster/internal/create/actions/cluster/templates/gcp.tmpl @@ -299,11 +299,11 @@ spec: name: {{`'{{ ds.meta_data.local_hostname.split(\".\")[0] }}'`}} kubeletExtraArgs: cloud-provider: gce - {{- if $node.Labels }} + {{- if gt (len $node.Labels) 0 }} node-labels: \"{{ range $key, $value := $node.Labels }}{{ $key }}={{ $value }},{{- end }}\" {{- end }} {{- if gt (len $node.Taints) 0 }} - register-with-taints: \"{{ range $i, $taint := $node.Taints }}{{$taint.Key}}={{$taint.Value}}:{{$taint.Effect}}{{ $len := len $node.Taints }}{{- if lastElement $i $len }}{{- else }},{{- end }}{{- end }}\" + register-with-taints: \"{{ range $i, $taint := $node.Taints }}{{ $taint.Key }}={{ $taint.Value }}:{{ $taint.Effect }}{{ $len := len $node.Taints }}{{- if lastElement $i $len }}{{- else }},{{- end }}{{- end }}\" {{- end }} {{- end }} {{- end }}