Skip to content

Commit

Permalink
Merge branch 'master' into instance-role-arn-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbeaumont authored Oct 6, 2020
2 parents c7c2ff0 + eff895a commit cd88cb4
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ form of a label. The scheme of priorities looks like this:

- **awaiting-more-evidence**: Possibly useful, but not yet enough support to actually get it done. These are mostly place-holders for potentially good ideas, so that they don't get completely forgotten, and can be referenced /deduped every time they come up.

These priority categories have been inspired by [the Kuberntes contributing guide](https://github.com/kubernetes/community/blob/master/contributors/guide/issue-triage.md).
These priority categories have been inspired by [the Kubernetes contributing guide](https://github.com/kubernetes/community/blob/master/contributors/guide/issue-triage.md).

## Getting Started

Expand Down
8 changes: 8 additions & 0 deletions docs/release_notes/0.29.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Release 0.29.1

## Bug Fixes

- Do OIDC provider and SA creation before nodegroups (#2703)

## Acknowledgments
Weaveworks would like to sincerely thank our contributors!
8 changes: 4 additions & 4 deletions pkg/apis/eksctl.io/v1alpha5/assets/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,8 @@
},
"volumeType": {
"type": "string",
"description": "Valid variants are: `\"gp2\"` is General Purpose SSD (default), `\"io1\"` is Provisioned IOPS SSD, `\"sc1\"` is Throughput Optimized HDD, `\"st1\"` is Cold HDD.",
"x-intellij-html-description": "Valid variants are: <code>&quot;gp2&quot;</code> is General Purpose SSD (default), <code>&quot;io1&quot;</code> is Provisioned IOPS SSD, <code>&quot;sc1&quot;</code> is Throughput Optimized HDD, <code>&quot;st1&quot;</code> is Cold HDD.",
"description": "Valid variants are: `\"gp2\"` is General Purpose SSD (default), `\"io1\"` is Provisioned IOPS SSD, `\"sc1\"` is Cold HDD, `\"st1\"` is Throughput Optimized HDD.",
"x-intellij-html-description": "Valid variants are: <code>&quot;gp2&quot;</code> is General Purpose SSD (default), <code>&quot;io1&quot;</code> is Provisioned IOPS SSD, <code>&quot;sc1&quot;</code> is Cold HDD, <code>&quot;st1&quot;</code> is Throughput Optimized HDD.",
"default": "gp2",
"enum": [
"gp2",
Expand Down Expand Up @@ -1066,8 +1066,8 @@
},
"volumeType": {
"type": "string",
"description": "Valid variants are: `\"gp2\"` is General Purpose SSD (default), `\"io1\"` is Provisioned IOPS SSD, `\"sc1\"` is Throughput Optimized HDD, `\"st1\"` is Cold HDD.",
"x-intellij-html-description": "Valid variants are: <code>&quot;gp2&quot;</code> is General Purpose SSD (default), <code>&quot;io1&quot;</code> is Provisioned IOPS SSD, <code>&quot;sc1&quot;</code> is Throughput Optimized HDD, <code>&quot;st1&quot;</code> is Cold HDD.",
"description": "Valid variants are: `\"gp2\"` is General Purpose SSD (default), `\"io1\"` is Provisioned IOPS SSD, `\"sc1\"` is Cold HDD, `\"st1\"` is Throughput Optimized HDD.",
"x-intellij-html-description": "Valid variants are: <code>&quot;gp2&quot;</code> is General Purpose SSD (default), <code>&quot;io1&quot;</code> is Provisioned IOPS SSD, <code>&quot;sc1&quot;</code> is Cold HDD, <code>&quot;st1&quot;</code> is Throughput Optimized HDD.",
"default": "gp2",
"enum": [
"gp2",
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/eksctl.io/v1alpha5/schema.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/apis/eksctl.io/v1alpha5/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ const (
NodeVolumeTypeGP2 = "gp2"
// NodeVolumeTypeIO1 is Provisioned IOPS SSD
NodeVolumeTypeIO1 = "io1"
// NodeVolumeTypeSC1 is Throughput Optimized HDD
// NodeVolumeTypeSC1 is Cold HDD
NodeVolumeTypeSC1 = "sc1"
// NodeVolumeTypeST1 is Cold HDD
// NodeVolumeTypeST1 is Throughput Optimized HDD
NodeVolumeTypeST1 = "st1"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cfn/manager/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type StackInfo struct {
Template *string
}

// TemplateData is an union (sum type) to describe template data.
// TemplateData is a union (sum type) to describe template data.
type TemplateData interface {
isTemplateData()
}
Expand Down
9 changes: 2 additions & 7 deletions pkg/ctl/create/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,10 @@ func doCreateCluster(cmd *cmdutils.Cmd, ngFilter *filter.NodeGroupFilter, params
return err
}

// tasks depending on the control plane availability
tasks := ctl.NewTasksRequiringControlPlane(cfg)
ngTasks := ctl.ClusterTasksForNodeGroups(cfg, params.InstallNeuronDevicePlugin)
if ngTasks.Len() > 0 {
tasks.Append(ngTasks)
}

logger.Info(tasks.Describe())
if errs := tasks.DoAllSync(); len(errs) > 0 {
logger.Info(ngTasks.Describe())
if errs := ngTasks.DoAllSync(); len(errs) > 0 {
logger.Warning("%d error(s) occurred and post actions have failed, you may wish to check CloudFormation console", len(errs))
logger.Info("to cleanup resources, run 'eksctl delete cluster --region=%s --name=%s'", meta.Region, meta.Name)
for _, err := range errs {
Expand Down
4 changes: 2 additions & 2 deletions pkg/ctl/drain/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ func drainNodeGroupWithRunFunc(cmd *cmdutils.Cmd, runFunc func(cmd *cmdutils.Cmd
cmd.FlagSetGroup.InFlagSet("General", func(fs *pflag.FlagSet) {
fs.StringVar(&cfg.Metadata.Name, "cluster", "", "EKS cluster name")
cmdutils.AddRegionFlag(fs, &cmd.ProviderConfig)
fs.StringVarP(&ng.Name, "name", "n", "", "Name of the nodegroup to delete")
fs.StringVarP(&ng.Name, "name", "n", "", "Name of the nodegroup to drain")
cmdutils.AddConfigFileFlag(fs, &cmd.ClusterConfigFile)
cmdutils.AddApproveFlag(fs, cmd)
cmdutils.AddNodeGroupFilterFlags(fs, &cmd.Include, &cmd.Exclude)
fs.BoolVar(&onlyMissing, "only-missing", false, "Only drain nodegroups that are not defined in the given config file")
fs.BoolVar(&undo, "undo", false, "Uncordone the nodegroup")
fs.BoolVar(&undo, "undo", false, "Uncordon the nodegroup")
defaultMaxGracePeriod, _ := time.ParseDuration("10m")
fs.DurationVar(&maxGracePeriod, "max-grace-period", defaultMaxGracePeriod, "Maximum pods termination grace period")
cmdutils.AddTimeoutFlag(fs, &cmd.ProviderConfig.WaitTimeout)
Expand Down
13 changes: 2 additions & 11 deletions pkg/eks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,12 @@ func (c *ClusterProvider) CreateExtraClusterConfigTasks(cfg *api.ClusterConfig,
spec: cfg,
})
}
return newTasks
}

// NewTasksRequiringControlPlane returns all tasks for updating cluster configuration depending on the control plane availability
// or nil if there are no tasks
func (c *ClusterProvider) NewTasksRequiringControlPlane(cfg *api.ClusterConfig) *manager.TaskTree {
tasks := &manager.TaskTree{
Parallel: false,
IsSubTask: true,
}
if api.IsEnabled(cfg.IAM.WithOIDC) {
c.appendCreateTasksForIAMServiceAccounts(cfg, tasks)
c.appendCreateTasksForIAMServiceAccounts(cfg, newTasks)
}

return tasks
return newTasks
}

// ClusterTasksForNodeGroups returns all tasks dependent on node groups
Expand Down
6 changes: 5 additions & 1 deletion pkg/gitops/deploykey/deploykey.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func GetDeployKeyClient(ctx context.Context, url string) (gitprovider.DeployKeyC
return nil, errors.New("only GitHub URLs are currently supported")
}
githubToken := os.Getenv(githubTokenVariable)
if githubToken == "" {
return nil, errors.Errorf("%s not set", githubTokenVariable)
}
gh, err := github.NewClient(github.WithOAuth2Token(githubToken))
if err != nil {
return nil, err
Expand All @@ -31,12 +34,13 @@ func GetDeployKeyClient(ctx context.Context, url string) (gitprovider.DeployKeyC
if len(ownerRepo) != 2 {
return nil, errors.New("couldn't understand path of URL")
}
repoName := strings.TrimSuffix(ownerRepo[1], ".git")
rep, err := gh.UserRepositories().Get(ctx, gitprovider.UserRepositoryRef{
UserRef: gitprovider.UserRef{
Domain: github.DefaultDomain,
UserLogin: ownerRepo[0],
},
RepositoryName: ownerRepo[1],
RepositoryName: repoName,
})
if err != nil {
return nil, err
Expand Down
21 changes: 11 additions & 10 deletions pkg/managed/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/pkg/errors"
"github.com/tidwall/gjson"
"github.com/tidwall/sjson"
"github.com/weaveworks/eksctl/pkg/version"
"github.com/weaveworks/goformation/v4/cloudformation"

"github.com/weaveworks/eksctl/pkg/ami"
Expand Down Expand Up @@ -184,7 +185,7 @@ func (m *Service) UpgradeNodeGroup(options UpgradeOptions) error {
return nil
}

requiresUpdate, err := m.requiresStackFormatUpdate(options.NodegroupName)
requiresUpdate, err := m.requiresStackUpdate(options.NodegroupName)
if err != nil {
return err
}
Expand Down Expand Up @@ -248,7 +249,7 @@ func (m *Service) UpgradeNodeGroup(options UpgradeOptions) error {
return nil
}

func (m *Service) requiresStackFormatUpdate(nodeGroupName string) (bool, error) {
func (m *Service) requiresStackUpdate(nodeGroupName string) (bool, error) {
ngStack, err := m.stackCollection.DescribeNodeGroupStack(nodeGroupName)
if err != nil {
return false, err
Expand All @@ -258,15 +259,15 @@ func (m *Service) requiresStackFormatUpdate(nodeGroupName string) (bool, error)
if err != nil {
return false, err
}
if found {
newFormatVersion := semver.Version{
Major: 0,
Minor: 25,
Patch: 0,
}
return ver.LT(newFormatVersion), nil
if !found {
return true, nil
}

curVer, err := semver.ParseTolerant(version.GetVersion())
if err != nil {
return false, errors.Wrap(err, "unexpected error parsing current eksctl version")
}
return true, nil
return !ver.EQ(curVer), nil
}

func (m *Service) getLatestReleaseVersion(kubernetesVersion string, nodeGroup *eks.Nodegroup) (string, error) {
Expand Down
4 changes: 2 additions & 2 deletions userdocs/src/usage/windows-worker-nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ To create a new cluster without using a config file, issue the following command
```console
eksctl create cluster --name=windows-cluster --node-ami-family=WindowsServer2019CoreContainer
eksctl create nodegroup --cluster=windows-cluster --node-ami-family=AmazonLinux2 --nodes-min=2 --node-type=t2.large
eksctl utils install-vpc-controllers --name=windows-cluster --approve
eksctl utils install-vpc-controllers --cluster=windows-cluster --approve
```


Expand All @@ -51,7 +51,7 @@ To enable running Windows workloads on an existing cluster with Linux nodes (`Am

```console
eksctl create nodegroup --cluster=existing-cluster --node-ami-family=WindowsServer2019CoreContainer
eksctl utils install-vpc-controllers --name=windows-cluster --approve
eksctl utils install-vpc-controllers --cluster=windows-cluster --approve
```

To ensure workloads are scheduled on the right OS, they must have a `nodeSelector` targeting the OS it must run on:
Expand Down

0 comments on commit cd88cb4

Please sign in to comment.