Implement EKS support [#5]

I *think* this will work, but without access to an EKS cluster I can't
actually test it.
This commit is contained in:
Erin Call
2019-12-27 10:39:06 -08:00
parent d8d2e33b20
commit 9c1ed849ab
7 changed files with 68 additions and 3 deletions

View File

@@ -23,6 +23,8 @@ type Config struct {
ValuesFiles []string `split_words:"true"` // Arguments to pass to --values in applicable helm commands
Namespace string `` // Kubernetes namespace for all helm commands
KubeToken string `envconfig:"KUBERNETES_TOKEN"` // Kubernetes authentication token to put in .kube/config
EKSCluster string `envconfig:"EKS_CLUSTER"` // AWS EKS Cluster ID to put in .kube/config
EKSRoleARN string `envconfig:"EKS_ROLE_ARN"` // AWS IAM role resource name to put in .kube/config
SkipTLSVerify bool `envconfig:"SKIP_TLS_VERIFY"` // Put insecure-skip-tls-verify in .kube/config
Certificate string `envconfig:"KUBERNETES_CERTIFICATE"` // The Kubernetes cluster CA's self-signed certificate (must be base64-encoded)
APIServer string `envconfig:"API_SERVER"` // The Kubernetes cluster's API endpoint

View File

@@ -142,6 +142,8 @@ func initKube(cfg Config) []Step {
APIServer: cfg.APIServer,
ServiceAccount: cfg.ServiceAccount,
Token: cfg.KubeToken,
EKSCluster: cfg.EKSCluster,
EKSRoleARN: cfg.EKSRoleARN,
TemplateFile: kubeConfigTemplate,
ConfigFile: kubeConfigFile,
},

View File

@@ -212,6 +212,8 @@ func (suite *PlanTestSuite) TestInitKube() {
Certificate: "b2Ygd29rZW5lc3MK",
APIServer: "123.456.78.9",
ServiceAccount: "helmet",
EKSCluster: "eks_reader",
EKSRoleARN: "arn:aws:iam::9631085:role/eksSpangleRole",
}
steps := initKube(cfg)
@@ -225,6 +227,8 @@ func (suite *PlanTestSuite) TestInitKube() {
APIServer: "123.456.78.9",
ServiceAccount: "helmet",
Token: "cXVlZXIgY2hhcmFjdGVyCg==",
EKSCluster: "eks_reader",
EKSRoleARN: "arn:aws:iam::9631085:role/eksSpangleRole",
TemplateFile: kubeConfigTemplate,
ConfigFile: kubeConfigFile,
}