-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: support "AWS_K8S_TESTER_EKS_SKIP_DELETE_CLUSTER_AND_NODES" #128
Conversation
@@ -9,9 +9,20 @@ | |||
|
|||
See [code changes](https://github.com/aws/aws-k8s-tester/compare/v1.4.5...v1.4.6). | |||
|
|||
### `eksconfig` | |||
|
|||
- Add [`SkipDeleteClusterAndNodes` to skip EKS cluster and nodes deletion](https://github.com/aws/aws-k8s-tester/commit/565635179860b4832b64cbe3b39fdbe1c12b1ae1). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider calling this "Attach to cluster"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of skipping, can we idempotently check that it already exists and just succeed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking even higher level, how much effort would it be to make everything within AKT idempotent, so that we could modify the yaml config and it would simply execute the deltas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean skipping creation? Creation is already done here
aws-k8s-tester/eks/cluster/cluster.go
Lines 288 to 303 in 4cad9b3
func (ts *tester) createEKS() (err error) { | |
fmt.Printf(ts.cfg.EKSConfig.Colorize("\n\n[yellow]*********************************\n")) | |
fmt.Printf(ts.cfg.EKSConfig.Colorize("[light_green]createEKS [default](%q)\n"), ts.cfg.EKSConfig.ConfigPath) | |
if ts.cfg.EKSConfig.Status.ClusterCFNStackID != "" || | |
ts.cfg.EKSConfig.Status.ClusterARN != "" || | |
ts.cfg.EKSConfig.Status.ClusterAPIServerEndpoint != "" || | |
ts.cfg.EKSConfig.Status.ClusterCA != "" || | |
ts.cfg.EKSConfig.Status.ClusterCADecoded != "" { | |
ts.cfg.Logger.Info("non-empty cluster given; no need to create a new one", zap.String("status", ts.cfg.EKSConfig.Status.ClusterStatusCurrent)) | |
return nil | |
} | |
if ts.cfg.EKSConfig.Status.Up { | |
ts.cfg.Logger.Info("cluster is up; no need to create cluster") | |
return nil | |
} |
which means you can run create cluster
command multiple times and it will automatically skip if already created.
- If true, delete operation keeps all resources created before cluster (e.g. IAM role, VPC, CMK, etc.). | ||
- Set via `AWS_K8S_TESTER_EKS_SKIP_DELETE_CLUSTER_AND_NODES=true`. | ||
- Default `AWS_K8S_TESTER_EKS_SKIP_DELETE_CLUSTER_AND_NODES=false`. | ||
- `aws-k8s-tester eks create cluster --path` must be passed a valid configuration file with existing cluster information in order to use the existing cluster. Create cluster once, and delete all add-ons, and keep the cluster related fields in the YAML with all other fields removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with this path to yaml eventually be our custom resource yaml config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
848953f
to
17f720f
Compare
Signed-off-by: Gyuho Lee <[email protected]>
… true Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Partially address #123.
Short-term solution without breaking changes.