Rework of resource consumer.

Major rework of resource consumer: added controller running as a pod that spreads requests around consumers. This should fix #21664 and #23536.
This commit is contained in:
Jerzy Szczepkowski
2016-05-10 09:42:12 +02:00
parent 2976e892a4
commit 967a7c95d2
8 changed files with 429 additions and 136 deletions

View File

@@ -271,6 +271,7 @@ type RCConfig struct {
MemRequest int64 // bytes
MemLimit int64 // bytes
ReadinessProbe *api.Probe
DNSPolicy *api.DNSPolicy
// Env vars, set the same for every pod.
Env map[string]string
@@ -2181,6 +2182,10 @@ func RunRC(config RCConfig) error {
func (config *RCConfig) create() error {
By(fmt.Sprintf("creating replication controller %s in namespace %s", config.Name, config.Namespace))
dnsDefault := api.DNSDefault
if config.DNSPolicy == nil {
config.DNSPolicy = &dnsDefault
}
rc := &api.ReplicationController{
ObjectMeta: api.ObjectMeta{
Name: config.Name,
@@ -2204,7 +2209,7 @@ func (config *RCConfig) create() error {
ReadinessProbe: config.ReadinessProbe,
},
},
DNSPolicy: api.DNSDefault,
DNSPolicy: *config.DNSPolicy,
},
},
},