Skip to content

Commit

Permalink
*: install metrics-server at the very beginning
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Jun 15, 2020
1 parent bcbc5b7 commit f478b09
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 41 deletions.
10 changes: 5 additions & 5 deletions eks/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,26 +450,26 @@ func (ts *Tester) createTesters() (err error) {
})

ts.testers = []eks_tester.Tester{
conformance.New(conformance.Config{
metrics_server.New(metrics_server.Config{
Logger: ts.lg,
Stopc: ts.stopCreationCh,
EKSConfig: ts.cfg,
K8SClient: ts.k8sClient,
}),
app_mesh.New(app_mesh.Config{
conformance.New(conformance.Config{
Logger: ts.lg,
Stopc: ts.stopCreationCh,
EKSConfig: ts.cfg,
K8SClient: ts.k8sClient,
CFNAPI: ts.cfnAPI,
}),
csi_ebs.New(csi_ebs.Config{
app_mesh.New(app_mesh.Config{
Logger: ts.lg,
Stopc: ts.stopCreationCh,
EKSConfig: ts.cfg,
K8SClient: ts.k8sClient,
CFNAPI: ts.cfnAPI,
}),
metrics_server.New(metrics_server.Config{
csi_ebs.New(csi_ebs.Config{
Logger: ts.lg,
Stopc: ts.stopCreationCh,
EKSConfig: ts.cfg,
Expand Down
22 changes: 11 additions & 11 deletions eksconfig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# set the following *_ENABLE env vars to enable add-ons, rest are set with default values
AWS_K8S_TESTER_EKS_ADD_ON_NODE_GROUPS_ENABLE=true \
AWS_K8S_TESTER_EKS_ADD_ON_MANAGED_NODE_GROUPS_ENABLE=true \
AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_ENABLE=true \
AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_ENABLE=true \
AWS_K8S_TESTER_EKS_ADD_ON_APP_MESH_ENABLE=true \
AWS_K8S_TESTER_EKS_ADD_ON_CSI_EBS_ENABLE=true \
AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_ENABLE=true \
AWS_K8S_TESTER_EKS_ADD_ON_KUBERNETES_DASHBOARD_ENABLE=true \
AWS_K8S_TESTER_EKS_ADD_ON_PROMETHEUS_GRAFANA_ENABLE=true \
AWS_K8S_TESTER_EKS_ADD_ON_NLB_HELLO_WORLD_ENABLE=true \
Expand Down Expand Up @@ -168,6 +168,16 @@ AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_VERSION_UPGRADE_ENABLE=true \
*-----------------------------------------------------------------------------*-------------------*------------------------------------------------------------*--------------------------*
*------------------------------------------------------------*-------------------*-----------------------------------------------*--------------------*
| ENVIRONMENTAL VARIABLE | READ ONLY | TYPE | GO TYPE |
*------------------------------------------------------------*-------------------*-----------------------------------------------*--------------------*
| AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_ENABLE | read-only "false" | *eksconfig.AddOnMetricsServer.Enable | bool |
| AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_CREATED | read-only "true" | *eksconfig.AddOnMetricsServer.Created | bool |
| AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_TIME_FRAME_CREATE | read-only "true" | *eksconfig.AddOnMetricsServer.TimeFrameCreate | timeutil.TimeFrame |
| AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_TIME_FRAME_DELETE | read-only "true" | *eksconfig.AddOnMetricsServer.TimeFrameDelete | timeutil.TimeFrame |
*------------------------------------------------------------*-------------------*-----------------------------------------------*--------------------*
*---------------------------------------------------------------------------*-------------------*-------------------------------------------------------------*--------------------*
| ENVIRONMENTAL VARIABLE | READ ONLY | TYPE | GO TYPE |
*---------------------------------------------------------------------------*-------------------*-------------------------------------------------------------*--------------------*
Expand Down Expand Up @@ -217,16 +227,6 @@ AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_VERSION_UPGRADE_ENABLE=true \
*-----------------------------------------------------*-------------------*----------------------------------------*--------------------*
*------------------------------------------------------------*-------------------*-----------------------------------------------*--------------------*
| ENVIRONMENTAL VARIABLE | READ ONLY | TYPE | GO TYPE |
*------------------------------------------------------------*-------------------*-----------------------------------------------*--------------------*
| AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_ENABLE | read-only "false" | *eksconfig.AddOnMetricsServer.Enable | bool |
| AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_CREATED | read-only "true" | *eksconfig.AddOnMetricsServer.Created | bool |
| AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_TIME_FRAME_CREATE | read-only "true" | *eksconfig.AddOnMetricsServer.TimeFrameCreate | timeutil.TimeFrame |
| AWS_K8S_TESTER_EKS_ADD_ON_METRICS_SERVER_TIME_FRAME_DELETE | read-only "true" | *eksconfig.AddOnMetricsServer.TimeFrameDelete | timeutil.TimeFrame |
*------------------------------------------------------------*-------------------*-----------------------------------------------*--------------------*
*---------------------------------------------------------------------*-------------------*---------------------------------------------------------*--------------------*
| ENVIRONMENTAL VARIABLE | READ ONLY | TYPE | GO TYPE |
*---------------------------------------------------------------------*-------------------*---------------------------------------------------------*--------------------*
Expand Down
9 changes: 5 additions & 4 deletions eksconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ type Config struct {
TotalNodes int64 `json:"total-nodes" read-only:"true"`
TotalHollowNodes int64 `json:"total-hollow-nodes" read-only:"true"`

// AddOnMetricsServer defines parameters for EKS cluster
// add-on metrics server.
AddOnMetricsServer *AddOnMetricsServer `json:"add-on-metrics-server,omitempty"`

// AddOnConformance defines parameters for EKS cluster
// add-on Conformance.
AddOnConformance *AddOnConformance `json:"add-on-conformance,omitempty"`
Expand All @@ -198,9 +202,6 @@ type Config struct {
// AddOnCSIEBS defines parameters for EKS cluster
// add-on AWS EBS CSI Driver.
AddOnCSIEBS *AddOnCSIEBS `json:"add-on-csi-ebs,omitempty"`
// AddOnMetricsServer defines parameters for EKS cluster
// add-on metrics server.
AddOnMetricsServer *AddOnMetricsServer `json:"add-on-metrics-server,omitempty"`
// AddOnKubernetesDashboard defines parameters for EKS cluster
// add-on Dashboard.
AddOnKubernetesDashboard *AddOnKubernetesDashboard `json:"add-on-kubernetes-dashboard,omitempty"`
Expand Down Expand Up @@ -748,10 +749,10 @@ func NewDefault() *Config {

AddOnNodeGroups: getDefaultAddOnNodeGroups(name),
AddOnManagedNodeGroups: getDefaultAddOnManagedNodeGroups(name),
AddOnMetricsServer: getDefaultAddOnMetricsServer(),
AddOnConformance: getDefaultAddOnConformance(),
AddOnCSIEBS: getDefaultAddOnCSIEBS(),
AddOnAppMesh: getDefaultAddOnAppMesh(),
AddOnMetricsServer: getDefaultAddOnMetricsServer(),
AddOnKubernetesDashboard: getDefaultAddOnKubernetesDashboard(),
AddOnPrometheusGrafana: getDefaultAddOnPrometheusGrafana(),
AddOnNLBHelloWorld: getDefaultAddOnNLBHelloWorld(),
Expand Down
8 changes: 4 additions & 4 deletions eksconfig/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ log-level: info
log-outputs:
- stderr
- /home/ANT.AMAZON.COM/leegyuho/go/src/github.com/aws/aws-k8s-tester/eksconfig/default.log
name: eks-2020061416-wandering3bu
name: eks-2020061417-grass9ev3hi4
on-failure-delete: true
on-failure-delete-wait-seconds: 120
parameters:
Expand All @@ -41,7 +41,7 @@ parameters:
role-cfn-stack-yaml-file-path: /home/ANT.AMAZON.COM/leegyuho/go/src/github.com/aws/aws-k8s-tester/eksconfig/default.role.cfn.yaml
role-create: true
role-managed-policy-arns: null
role-name: eks-2020061416-wandering3bu-role
role-name: eks-2020061417-grass9ev3hi4-role
role-service-principals: null
signing-name: eks
tags: null
Expand All @@ -55,8 +55,8 @@ partition: aws
region: us-west-2
remote-access-commands-output-path: /home/ANT.AMAZON.COM/leegyuho/go/src/github.com/aws/aws-k8s-tester/eksconfig/default.ssh.sh
remote-access-key-create: true
remote-access-key-name: eks-2020061416-wandering3bu-remote-access-key
remote-access-private-key-path: /tmp/coffee1vy23sjpe.insecure.key
remote-access-key-name: eks-2020061417-grass9ev3hi4-remote-access-key
remote-access-private-key-path: /tmp/sunrise395jq7hj.insecure.key
s3-bucket-create: false
s3-bucket-create-keep: false
s3-bucket-lifecycle-expiration-days: 0
Expand Down
26 changes: 13 additions & 13 deletions eksconfig/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ func (cfg *Config) UpdateFromEnvs() (err error) {
return fmt.Errorf("expected *AddOnManagedNodeGroups, got %T", vv)
}

if cfg.AddOnMetricsServer == nil {
cfg.AddOnMetricsServer = &AddOnMetricsServer{}
}
vv, err = parseEnvs(EnvironmentVariablePrefixAddOnMetricsServer, cfg.AddOnMetricsServer)
if err != nil {
return err
}
if av, ok := vv.(*AddOnMetricsServer); ok {
cfg.AddOnMetricsServer = av
} else {
return fmt.Errorf("expected *AddOnMetricsServer, got %T", vv)
}

if cfg.AddOnConformance == nil {
cfg.AddOnConformance = &AddOnConformance{}
}
Expand Down Expand Up @@ -313,19 +326,6 @@ func (cfg *Config) UpdateFromEnvs() (err error) {
return fmt.Errorf("expected *AddOnWordpress, got %T", vv)
}

if cfg.AddOnMetricsServer == nil {
cfg.AddOnMetricsServer = &AddOnMetricsServer{}
}
vv, err = parseEnvs(EnvironmentVariablePrefixAddOnMetricsServer, cfg.AddOnMetricsServer)
if err != nil {
return err
}
if av, ok := vv.(*AddOnMetricsServer); ok {
cfg.AddOnMetricsServer = av
} else {
return fmt.Errorf("expected *AddOnMetricsServer, got %T", vv)
}

if cfg.AddOnKubernetesDashboard == nil {
cfg.AddOnKubernetesDashboard = &AddOnKubernetesDashboard{}
}
Expand Down
8 changes: 4 additions & 4 deletions eksconfig/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ func createDoc() string {

b.WriteByte('\n')
b.WriteByte('\n')
b.WriteString(es.writeDoc(eksconfig.EnvironmentVariablePrefixAddOnConformance, &eksconfig.AddOnConformance{}))
b.WriteString(es.writeDoc(eksconfig.EnvironmentVariablePrefixAddOnMetricsServer, &eksconfig.AddOnMetricsServer{}))

b.WriteByte('\n')
b.WriteByte('\n')
b.WriteString(es.writeDoc(eksconfig.EnvironmentVariablePrefixAddOnAppMesh, &eksconfig.AddOnAppMesh{}))
b.WriteString(es.writeDoc(eksconfig.EnvironmentVariablePrefixAddOnConformance, &eksconfig.AddOnConformance{}))

b.WriteByte('\n')
b.WriteByte('\n')
b.WriteString(es.writeDoc(eksconfig.EnvironmentVariablePrefixAddOnCSIEBS, &eksconfig.AddOnCSIEBS{}))
b.WriteString(es.writeDoc(eksconfig.EnvironmentVariablePrefixAddOnAppMesh, &eksconfig.AddOnAppMesh{}))

b.WriteByte('\n')
b.WriteByte('\n')
b.WriteString(es.writeDoc(eksconfig.EnvironmentVariablePrefixAddOnMetricsServer, &eksconfig.AddOnMetricsServer{}))
b.WriteString(es.writeDoc(eksconfig.EnvironmentVariablePrefixAddOnCSIEBS, &eksconfig.AddOnCSIEBS{}))

b.WriteByte('\n')
b.WriteByte('\n')
Expand Down

0 comments on commit f478b09

Please sign in to comment.