mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-25 12:17:52 +00:00
test: e2e: HPA ContainerResource
This add e2e test for HPA ContainerResource metrics. This add test to cover two scenarios 1. Scale up on a busy application with an idle sidecar container 2. Do not scale up on a busy sidecar with an idle application. Signed-off-by: Vivek Singh <svivekkumar@vmware.com>
This commit is contained in:
@@ -181,6 +181,9 @@ type RCConfig struct {
|
||||
ConfigMapNames []string
|
||||
|
||||
ServiceAccountTokenProjections int
|
||||
|
||||
//Additional containers to run in the pod
|
||||
AdditionalContainers []v1.Container
|
||||
}
|
||||
|
||||
func (rc *RCConfig) RCConfigLog(fmt string, args ...interface{}) {
|
||||
@@ -343,6 +346,10 @@ func (config *DeploymentConfig) create() error {
|
||||
},
|
||||
}
|
||||
|
||||
if len(config.AdditionalContainers) > 0 {
|
||||
deployment.Spec.Template.Spec.Containers = append(deployment.Spec.Template.Spec.Containers, config.AdditionalContainers...)
|
||||
}
|
||||
|
||||
if len(config.SecretNames) > 0 {
|
||||
attachSecrets(&deployment.Spec.Template, config.SecretNames)
|
||||
}
|
||||
@@ -425,6 +432,10 @@ func (config *ReplicaSetConfig) create() error {
|
||||
},
|
||||
}
|
||||
|
||||
if len(config.AdditionalContainers) > 0 {
|
||||
rs.Spec.Template.Spec.Containers = append(rs.Spec.Template.Spec.Containers, config.AdditionalContainers...)
|
||||
}
|
||||
|
||||
if len(config.SecretNames) > 0 {
|
||||
attachSecrets(&rs.Spec.Template, config.SecretNames)
|
||||
}
|
||||
@@ -618,6 +629,10 @@ func (config *RCConfig) create() error {
|
||||
},
|
||||
}
|
||||
|
||||
if len(config.AdditionalContainers) > 0 {
|
||||
rc.Spec.Template.Spec.Containers = append(rc.Spec.Template.Spec.Containers, config.AdditionalContainers...)
|
||||
}
|
||||
|
||||
if len(config.SecretNames) > 0 {
|
||||
attachSecrets(rc.Spec.Template, config.SecretNames)
|
||||
}
|
||||
|
Reference in New Issue
Block a user