Skip to content

Commit

Permalink
Merge pull request #467 from sighupio/feat/upgrade-to-0-27-2
Browse files Browse the repository at this point in the history
Feat/upgrade to 0.27.2
  • Loading branch information
nutellinoit authored Jan 23, 2024
2 parents f7d39e0 + 24fce1f commit 10791a9
Show file tree
Hide file tree
Showing 17 changed files with 396 additions and 18 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- FIXME: UPDATE THE BUILD BADGE WITH THE RIGHT BRANCH -->

[![Build Status](https://ci.sighup.io/api/badges/sighupio/furyctl/status.svg)](https://ci.sighup.io/sighupio/furyctl)
![Release](https://img.shields.io/badge/furyctl-v0.27.1-blue)
![Release](https://img.shields.io/badge/furyctl-v0.27.2-blue)
![Slack](https://img.shields.io/badge/slack-@kubernetes/fury-yellow.svg?logo=slack)
![License](https://img.shields.io/github/license/sighupio/furyctl)
[![Go Report Card](https://goreportcard.com/badge/github.com/sighupio/furyctl)](https://goreportcard.com/report/github.com/sighupio/furyctl)
Expand Down Expand Up @@ -76,7 +76,7 @@ $ furyctl version
...
goVersion: go1.21
osArch: amd64
version: 0.27.1
version: 0.27.2
```

### Installing from source
Expand Down Expand Up @@ -169,7 +169,7 @@ Additionaly, the schema of the file is versioned with the `apiVersion` field, so
To scaffold a configuration file to use as a starter, you use the following command:

```console
furyctl create config --version v1.27.1 --kind "EKSCluster"
furyctl create config --version v1.27.2 --kind "EKSCluster"
```

> 💡 **TIP**
Expand Down
10 changes: 10 additions & 0 deletions configs/upgrades/ekscluster/1.27.1-1.27.2/pre-distribution.sh.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh

set -e

kubectlbin="{{ .paths.kubectl }}"

# Remove some validating webhooks during the upgrade
{{- if eq .spec.distribution.modules.policy.type "gatekeeper" }}
$kubectlbin delete --ignore-not-found=true validatingwebhookconfiguration gatekeeper-validating-webhook-configuration
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh

set -e

kubectlbin="{{ .paths.kubectl }}"

# Remove some validating webhooks during the upgrade
{{- if eq .spec.distribution.modules.policy.type "gatekeeper" }}
$kubectlbin delete --ignore-not-found=true validatingwebhookconfiguration gatekeeper-validating-webhook-configuration
{{- end }}
10 changes: 10 additions & 0 deletions configs/upgrades/onpremises/1.27.1-1.27.2/pre-distribution.sh.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh

set -e

kubectlbin="{{ .paths.kubectl }}"

# Remove some validating webhooks during the upgrade
{{- if eq .spec.distribution.modules.policy.type "gatekeeper" }}
$kubectlbin delete --ignore-not-found=true validatingwebhookconfiguration gatekeeper-validating-webhook-configuration
{{- end }}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/r3labs/diff/v3 v3.0.1
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
github.com/shirou/gopsutil/v3 v3.23.10
github.com/sighupio/fury-distribution v1.27.1
github.com/sighupio/fury-distribution v1.27.2
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.17.0
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,12 @@ github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnj
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/sighupio/fury-distribution v1.27.0 h1:3JTmmc8aPftWiA46RU30WROvZJIeyCHAgXRUwR7Vuqs=
github.com/sighupio/fury-distribution v1.27.0/go.mod h1:iYBnl0N/6zGPz3j3L2X6nzFC3nzNQtIkAzmaPfnO0zA=
github.com/sighupio/fury-distribution v1.27.1 h1:kZvHCJXQt4to7eL1FmJcmwbsS0VIq1l4cDWH5XaJBKM=
github.com/sighupio/fury-distribution v1.27.1/go.mod h1:iYBnl0N/6zGPz3j3L2X6nzFC3nzNQtIkAzmaPfnO0zA=
github.com/sighupio/fury-distribution v1.27.2-rc.22 h1:PhI/I4mQPyXT/E5IrPmlyOawGTZhgFMhKvV4Ib/i6Ig=
github.com/sighupio/fury-distribution v1.27.2-rc.22/go.mod h1:iYBnl0N/6zGPz3j3L2X6nzFC3nzNQtIkAzmaPfnO0zA=
github.com/sighupio/fury-distribution v1.27.2 h1:EiB/OoAD0mOAvmTUs/nM5KCUH1XjP7YJ9pTrpLrVPIg=
github.com/sighupio/fury-distribution v1.27.2/go.mod h1:iYBnl0N/6zGPz3j3L2X6nzFC3nzNQtIkAzmaPfnO0zA=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
Expand Down
18 changes: 9 additions & 9 deletions internal/apis/kfd/v1alpha2/common/create/preupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ import (
)

var (
errUpgradeCanceled = errors.New("upgrade canceled by user")
errUpgradeFlagNotSet = errors.New("upgrade flag not set by user")
errUpgradeWithReducersNotAllowed = errors.New("upgrade with reducers not allowed")
errUpgradePathNotFound = errors.New("upgrade path not found")
errGettingDistroVersionFrom = errors.New("error while getting distribution version from")
errGettingDistroVersionTo = errors.New("error while getting distribution version to")
errUpgradeCanceled = errors.New("upgrade canceled by user")
errUpgradeFlagNotSet = errors.New("upgrade flag not set by user")
errUpgradePathNotFound = errors.New("upgrade path not found")
errGettingDistroVersionFrom = errors.New("error while getting distribution version from")
errGettingDistroVersionTo = errors.New("error while getting distribution version to")
)

type PreUpgrade struct {
Expand Down Expand Up @@ -216,9 +215,10 @@ func (p *PreUpgrade) Exec() error {
return fmt.Errorf("error checking upgrade path: %w", err)
}

if len(p.reducers) > 0 {
return errUpgradeWithReducersNotAllowed
}
// We should find a smarer way to stop the process if the reducers are from the upgrade or not
// if len(p.reducers) > 0 {
// return errUpgradeWithReducersNotAllowed
// }.

if !p.forceFlag {
if _, err := fmt.Println("Are you sure you want to continue? Only 'yes' will be accepted to confirm."); err != nil {
Expand Down
7 changes: 4 additions & 3 deletions test/expensive/ekscluster/furyctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,19 @@ var (
_ = Describe("furyctl & distro v1.25.8 - public minimal", CreateAndDeleteTestScenario("1.25.8", false))
_ = Describe("furyctl & distro v1.25.9 - public minimal", CreateAndDeleteTestScenario("1.25.9", false))

_ = Describe("furyctl & distro v1.27.1 - public minimal - ephemeral", CreateAndDeleteTestScenario("1.25.9", true))
_ = Describe("furyctl & distro v1.25.9 - public minimal - ephemeral", CreateAndDeleteTestScenario("1.25.9", true))

_ = Describe("furyctl & distro v1.26.0 - public minimal", CreateAndDeleteTestScenario("1.26.0", false))
_ = Describe("furyctl & distro v1.26.1 - public minimal", CreateAndDeleteTestScenario("1.26.1", false))
_ = Describe("furyctl & distro v1.26.2 - public minimal", CreateAndDeleteTestScenario("1.26.2", false))
_ = Describe("furyctl & distro v1.26.3 - public minimal", CreateAndDeleteTestScenario("1.26.3", false))
_ = Describe("furyctl & distro v1.26.4 - public minimal", CreateAndDeleteTestScenario("1.26.4", false))

_ = Describe("furyctl & distro v1.27.1 - public minimal - ephemeral", CreateAndDeleteTestScenario("1.26.4", true))
_ = Describe("furyctl & distro v1.26.4 - public minimal - ephemeral", CreateAndDeleteTestScenario("1.26.4", true))

_ = Describe("furyctl & distro v1.27.0 - public minimal", CreateAndDeleteTestScenario("1.27.0", false))
_ = Describe("furyctl & distro v1.27.1 - public minimal", CreateAndDeleteTestScenario("1.27.1", false))
_ = Describe("furyctl & distro v1.27.2 - public minimal", CreateAndDeleteTestScenario("1.27.2", false))

_ = Describe("furyctl & distro v1.27.1 - public minimal - ephemeral", CreateAndDeleteTestScenario("1.27.1", true))
_ = Describe("furyctl & distro v1.27.2 - public minimal - ephemeral", CreateAndDeleteTestScenario("1.27.2", true))
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This file represents a minimal config for a public EKS cluster with 1.25.9 version
# and the least amount of modules enabled.
---
apiVersion: kfd.sighup.io/v1alpha2
kind: EKSCluster
metadata:
name: __CLUSTER_NAME__
spec:
distributionVersion: v1.27.2
toolsConfiguration:
terraform:
state:
s3:
bucketName: __CLUSTER_NAME__
keyPrefix: swe-dev/__CLUSTER_NAME__
region: eu-west-1
region: eu-west-1
tags:
env: "swe-dev"
k8s: "__CLUSTER_NAME__"
githubOrg: "sighupio"
githubRepo: "furyctl"
infrastructure:
vpc:
network:
cidr: 10.10.0.0/16
subnetsCidrs:
private:
- 10.10.0.0/20
- 10.10.16.0/20
- 10.10.32.0/20
- 10.10.48.0/20
public:
- 10.10.192.0/24
- 10.10.193.0/24
- 10.10.194.0/24
kubernetes:
apiServer:
privateAccess: false
publicAccess: true
privateAccessCidrs: ["0.0.0.0/0"]
publicAccessCidrs: ["0.0.0.0/0"]
nodeAllowedSshPublicKey: "{file://./id_ed25519.pub}"
nodePoolsLaunchKind: "launch_templates"
logRetentionDays: 1
nodePools:
- name: workers
size:
min: 1
max: 2
instance:
type: t3.xlarge
spot: true
volumeSize: 50
tags:
k8s.io/cluster-autoscaler/node-template/label/nodepool: "workers"
k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/role: "workers"
distribution:
modules:
auth:
provider:
type: none
ingress:
baseDomain: internal.example.dev
nginx:
type: none
tls:
provider: none
certManager:
clusterIssuer:
name: letsencrypt-fury
email: engineering@sighup.io
type: http01
dns:
public:
name: "example.dev"
create: true
private:
name: "internal.example.dev"
create: true
logging:
type: none
policy:
type: none
dr:
type: none
8 changes: 8 additions & 0 deletions test/expensive/kfddistribution/furyctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ var (

_ = Describe("furyctl & distro v1.27.0 - minimal", Ordered, Serial, CreateAndDeleteTestScenario("1.27.0", "v1.27.3", false))

_ = Describe("furyctl & distro v1.27.1 - minimal", Ordered, Serial, CreateAndDeleteTestScenario("1.27.1", "v1.27.3", false))

_ = Describe("furyctl & distro v1.27.2 - minimal", Ordered, Serial, CreateAndDeleteTestScenario("1.27.2", "v1.27.3", false))

_ = Describe("furyctl & distro v1.27.0 - minimal - ephemeral", Ordered, Serial, CreateAndDeleteTestScenario("1.27.0", "v1.27.3", true))

_ = Describe("furyctl & distro v1.25.4 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.25.4", "v1.25.11", false))
Expand All @@ -252,4 +256,8 @@ var (
_ = Describe("furyctl & distro v1.26.4 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.26.4", "v1.26.6", false))

_ = Describe("furyctl & distro v1.27.0 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.27.0", "v1.27.3", false))

_ = Describe("furyctl & distro v1.27.1 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.27.1", "v1.27.3", false))

_ = Describe("furyctl & distro v1.27.2 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.27.2", "v1.27.3", false))
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

---
apiVersion: kfd.sighup.io/v1alpha2
kind: KFDDistribution
metadata:
name: __CLUSTER_NAME__
spec:
distributionVersion: v1.27.1
distribution:
kubeconfig: __KUBECONFIG__
modules:
auth:
provider:
type: none
ingress:
baseDomain: internal.example.dev
nginx:
type: none
tls:
provider: none
logging:
type: none
networking:
type: calico
policy:
type: none
dr:
type: on-premises
velero: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

---
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30080
hostPort: 80
protocol: TCP
- containerPort: 30443
hostPort: 443
protocol: TCP
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

---
apiVersion: kfd.sighup.io/v1alpha2
kind: KFDDistribution
metadata:
name: __CLUSTER_NAME__
spec:
distributionVersion: v1.27.2
distribution:
kubeconfig: __KUBECONFIG__
modules:
auth:
provider:
type: none
ingress:
baseDomain: internal.example.dev
nginx:
type: none
tls:
provider: none
logging:
type: none
networking:
type: calico
policy:
type: none
dr:
type: on-premises
velero: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

---
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30080
hostPort: 80
protocol: TCP
- containerPort: 30443
hostPort: 443
protocol: TCP
8 changes: 8 additions & 0 deletions test/expensive/onpremises/furyctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,10 @@ var (

_ = Describe("furyctl & distro v1.27.0 - minimal", Ordered, Serial, CreateAndDeleteTestScenario("1.27.0", false))

_ = Describe("furyctl & distro v1.27.1 - minimal", Ordered, Serial, CreateAndDeleteTestScenario("1.27.1", false))

_ = Describe("furyctl & distro v1.27.2 - minimal", Ordered, Serial, CreateAndDeleteTestScenario("1.27.2", false))

_ = Describe("furyctl & distro v1.27.0 - minimal - ephemeral", Ordered, Serial, CreateAndDeleteTestScenario("1.27.0", true))

_ = Describe("furyctl & distro v1.25.9 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.25.9", false))
Expand All @@ -635,4 +639,8 @@ var (
_ = Describe("furyctl & distro v1.26.4 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.26.4", false))

_ = Describe("furyctl & distro v1.27.0 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.27.0", false))

_ = Describe("furyctl & distro v1.27.1 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.27.1", false))

_ = Describe("furyctl & distro v1.27.2 - minimal - by phase", Ordered, Serial, CreateAndDeleteByPhaseTestScenario("1.27.2", false))
)
Loading

0 comments on commit 10791a9

Please sign in to comment.