Skip to content
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

Stack tags #186

Merged
merged 5 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
234 changes: 205 additions & 29 deletions Gopkg.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ To use a pre-existing EC2 key pair in `us-east-1` region, you can specify key pa
eksctl create cluster --ssh-public-key=my_kubernetes_key --region=us-east-1
```

To add custom tags to each stack, you can specify tags:

This comment was marked as abuse.


```
eksctl create cluster --tags environment=staging --region=us-east-1
```

> NOTE: In `us-east-1` you are likely to get `UnsupportedAvailabilityZoneException`. If you do, copy the suggested zones and pass `--zones` flag, e.g. `eksctl create cluster --region=us-east-1 --zones=us-east-1a,us-east-1b,us-east-1d`. This may occur in other regions, but less likely. You shouldn't need to use `--zone` flag otherwise.

To delete a cluster, run:
Expand Down
3 changes: 2 additions & 1 deletion cmd/eksctl/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func createClusterCmd() *cobra.Command {
fs.StringVarP(&cfg.ClusterName, "name", "n", "", fmt.Sprintf("EKS cluster name (generated if unspecified, e.g. %q)", exampleClusterName))

fs.StringVarP(&cfg.Region, "region", "r", DEFAULT_EKS_REGION, "AWS region")
fs.StringVarP(&cfg.Profile, "profile", "p", "", "AWS creditials profile to use (overrides the AWS_PROFILE environment variable)")
fs.StringVarP(&cfg.Profile, "profile", "p", "", "AWS credentials profile to use (overrides the AWS_PROFILE environment variable)")
fs.StringToStringVarP(&cfg.Tags, "tags", "", map[string]string{}, "Custom tags")

This comment was marked as abuse.


fs.StringVarP(&cfg.NodeType, "node-type", "t", DEFAULT_NODE_TYPE, "node instance type")
fs.IntVarP(&cfg.Nodes, "nodes", "N", DEFAULT_NODE_COUNT, "total number of nodes (for a static ASG)")
Expand Down
3 changes: 2 additions & 1 deletion humans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Archis @archisgore
Stefan Prodan @stefanprodan
James Strachan @jstrachan
Nick @bowlesns
Josh Carp @jmcarp

/* Thanks */

Expand All @@ -30,4 +31,4 @@ Doctype: HTML5
IDE: VIM/VsCode/Atom
Generator: Jekyll (Ruby)
SCM: Git
Hosting: GitHub
Hosting: GitHub
11 changes: 8 additions & 3 deletions pkg/cfn/manager/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ func newTag(key, value string) *cloudformation.Tag {

// NewStackCollection create a stack manager for a single cluster
func NewStackCollection(provider api.ClusterProvider, spec *api.ClusterConfig) *StackCollection {
tags := []*cloudformation.Tag{
newTag(ClusterNameTag, spec.ClusterName),
}
for key, value := range spec.Tags {
tags = append(tags, newTag(key, value))
}
fmt.Println("TAGS", tags)

This comment was marked as abuse.

return &StackCollection{
cfn: provider.CloudFormation(),
spec: spec,
tags: []*cloudformation.Tag{
newTag(ClusterNameTag, spec.ClusterName),
},
tags: tags,
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/eks/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type ClusterProvider interface {
type ClusterConfig struct {
Region string
Profile string
Tags map[string]string
ClusterName string

NodeAMI string
Expand Down
10 changes: 4 additions & 6 deletions vendor/github.com/kubicorn/kubicorn/AUTHORS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading