Skip to content

Commit

Permalink
Merge pull request #186 from jmcarp/stack-tags
Browse files Browse the repository at this point in the history
Stack tags
  • Loading branch information
errordeveloper authored Sep 12, 2018
2 parents 2f553a2 + 74ee008 commit 5b246fe
Show file tree
Hide file tree
Showing 20 changed files with 650 additions and 2,566 deletions.
235 changes: 206 additions & 29 deletions Gopkg.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ 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 for all resources, use `--tags`. Note that until
https://github.com/weaveworks/eksctl/issues/25 is resolved, tags will
apply to CloudFormation stacks but not EKS clusters.

```
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
1 change: 1 addition & 0 deletions cmd/eksctl/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func createClusterCmd() *cobra.Command {

fs.StringVarP(&cfg.Region, "region", "r", api.DEFAULT_EKS_REGION, "AWS region")
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{}, `A list of KV pairs used to tag the AWS resources (e.g. "Owner=John Doe,Team=Some Team")`)

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
Kirsten Schumy @kschumy
Karinna Iniguez @karinnainiguez
Michael Seiwald @mseiwald
Expand All @@ -33,4 +34,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))
}
logger.Debug("tags = %#v", tags)
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 @@ -31,6 +31,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

0 comments on commit 5b246fe

Please sign in to comment.