Skip to content

Commit

Permalink
Support public/private API endpoints settings from file
Browse files Browse the repository at this point in the history
`update-cluster-endpoints` command changes API endpoint settings (eksctl-io#1149)

But this command doesn't read config file.
So when we use `-f` option, `eksctl` doesn't change settings.
  • Loading branch information
ota42y committed Dec 23, 2019
1 parent 0dd2468 commit bdca31d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pkg/ctl/utils/update_cluster_endpoint_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,17 @@ func doUpdateClusterEndpoints(cmd *cmdutils.Cmd, newPrivate bool, newPublic bool
logger.Info("current Kubernetes API endpoint access: privateAccess=%v, publicAccess=%v",
curPrivate, curPublic)

privateSet, publicSet := accessFlagsSet(cmd)
if !privateSet {
newPrivate = curPrivate
}
if !publicSet {
newPublic = curPublic
if cfg.VPC.ClusterEndpoints.PublicAccess != nil && cfg.VPC.ClusterEndpoints.PrivateAccess != nil {
newPublic = *cfg.VPC.ClusterEndpoints.PublicAccess
newPrivate = *cfg.VPC.ClusterEndpoints.PrivateAccess
}else{
privateSet, publicSet := accessFlagsSet(cmd)
if !privateSet {
newPrivate = curPrivate
}
if !publicSet {
newPublic = curPublic
}
}

// Nothing changed?
Expand Down
6 changes: 6 additions & 0 deletions site/content/usage/06-vpc-networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ The following is an example of how one could configure the Kubernetes API endpoi
eksctl utils update-cluster-endpoints --name=<clustername> --private-access=true --public-access=false
```

To update the setting using a `ClusterConfig` file, use:

```console
eksctl utils update-cluster-endpoints -f config.yaml
```

Note that if you don't pass a flag in it will keep the current value. Once you are satisfied with the proposed changes,
add the `approve` flag to make the change to the running cluster.

Expand Down

0 comments on commit bdca31d

Please sign in to comment.