vendor updates

This commit is contained in:
Serguei Bezverkhi
2018-03-06 17:33:18 -05:00
parent 4b3ebc171b
commit e9033989a0
5854 changed files with 248382 additions and 119809 deletions

View File

@ -1,4 +1,4 @@
amd64=gcr.io/google-containers/debian-base-amd64:0.3
arm=gcr.io/google-containers/debian-base-arm:0.3
arm64=gcr.io/google-containers/debian-base-arm64:0.3
ppc64le=gcr.io/google-containers/debian-base-ppc64le:0.3
amd64=k8s.gcr.io/debian-base-amd64:0.3
arm=k8s.gcr.io/debian-base-arm:0.3
arm64=k8s.gcr.io/debian-base-arm64:0.3
ppc64le=k8s.gcr.io/debian-base-ppc64le:0.3

View File

@ -8,8 +8,7 @@ load(
go_binary(
name = "resource-consumer",
importpath = "k8s.io/kubernetes/test/images/resource-consumer",
library = ":go_default_library",
embed = [":go_default_library"],
)
go_library(

View File

@ -21,7 +21,7 @@ The container consumes specified amount of resources:
- Memory in megabytes,
- Fake custom metrics.
###Consume CPU http request
### Consume CPU http request
- suffix "ConsumeCPU",
- parameters "millicores" and "durationSec".
@ -31,7 +31,7 @@ When CPU consumption is too low this binary uses cpu by calculating math.sqrt(0)
and if consumption is too high binary sleeps for 10 millisecond.
One replica of Resource Consumer cannot consume more that 1 cpu.
###Consume Memory http request
### Consume Memory http request
- suffix "ConsumeMem",
- parameters "megabytes" and "durationSec".
@ -39,16 +39,16 @@ Consumes specified amount of megabytes for durationSec seconds.
Consume Memory uses stress tool (stress -m 1 --vm-bytes megabytes --vm-hang 0 -t durationSec).
Request leading to consuming more memory then container limit will be ignored.
###Bump value of a fake custom metric
### Bump value of a fake custom metric
- suffix "BumpMetric",
- parameters "metric", "delta" and "durationSec".
Bumps metric with given name by delta for durationSec seconds.
Custom metrics in Prometheus format are exposed on "/metrics" endpoint.
###CURL example
### CURL example
```console
$ kubectl run resource-consumer --image=gcr.io/google_containers/resource_consumer:beta --expose --service-overrides='{ "spec": { "type": "LoadBalancer" } }' --port 8080
$ kubectl run resource-consumer --image=k8s.gcr.io/resource_consumer:beta --expose --service-overrides='{ "spec": { "type": "LoadBalancer" } }' --port 8080
$ kubectl get services resource-consumer
```
@ -62,24 +62,22 @@ $ curl --data "millicores=300&durationSec=600" http://<EXTERNAL-IP>:8080/Consume
## Image
Docker image of Resource Consumer can be found in Google Container Registry as gcr.io/google_containers/resource_consumer:beta
Docker image of Resource Consumer can be found in Google Container Registry as k8s.gcr.io/resource_consumer:beta
## Use cases
###Cluster size autoscaling
### Cluster size autoscaling
1. Consume more resources on each node that is specified for autoscaler
2. Observe that cluster size increased
###Horizontal autoscaling of pod
### Horizontal autoscaling of pod
1. Create consuming RC and start consuming appropriate amount of resources
2. Observe that RC has been resized
3. Observe that usage on each replica decreased
###Vertical autoscaling of pod
### Vertical autoscaling of pod
1. Create consuming pod and start consuming appropriate amount of resources
2. Observed that limits has been increased
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/test/images/resource-consumer/README.md?pixel)]()

View File

@ -8,8 +8,7 @@ load(
go_binary(
name = "consume-cpu",
importpath = "k8s.io/kubernetes/test/images/resource-consumer/consume-cpu",
library = ":go_default_library",
embed = [":go_default_library"],
)
go_library(

View File

@ -8,8 +8,7 @@ load(
go_binary(
name = "controller",
importpath = "k8s.io/kubernetes/test/images/resource-consumer/controller",
library = ":go_default_library",
embed = [":go_default_library"],
)
go_library(

View File

@ -78,7 +78,7 @@ func (handler *Controller) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
func (handler *Controller) handleConsumeCPU(w http.ResponseWriter, query url.Values) {
// geting string data for consumeCPU
// getting string data for consumeCPU
durationSecString := query.Get(DurationSecQuery)
millicoresString := query.Get(MillicoresQuery)
requestSizeInMillicoresString := query.Get(RequestSizeInMillicoresQuery)
@ -111,7 +111,7 @@ func (handler *Controller) handleConsumeCPU(w http.ResponseWriter, query url.Val
}
func (handler *Controller) handleConsumeMem(w http.ResponseWriter, query url.Values) {
// geting string data for consumeMem
// getting string data for consumeMem
durationSecString := query.Get(DurationSecQuery)
megabytesString := query.Get(MegabytesQuery)
requestSizeInMegabytesString := query.Get(RequestSizeInMegabytesQuery)
@ -144,7 +144,7 @@ func (handler *Controller) handleConsumeMem(w http.ResponseWriter, query url.Val
}
func (handler *Controller) handleBumpMetric(w http.ResponseWriter, query url.Values) {
// geting string data for handleBumpMetric
// getting string data for handleBumpMetric
metric := query.Get(MetricNameQuery)
deltaString := query.Get(DeltaQuery)
durationSecString := query.Get(DurationSecQuery)

View File

@ -75,7 +75,7 @@ func (handler *ResourceConsumerHandler) ServeHTTP(w http.ResponseWriter, req *ht
}
func (handler *ResourceConsumerHandler) handleConsumeCPU(w http.ResponseWriter, query url.Values) {
// geting string data for consumeCPU
// getting string data for consumeCPU
durationSecString := query.Get(DurationSecQuery)
millicoresString := query.Get(MillicoresQuery)
if durationSecString == "" || millicoresString == "" {
@ -98,7 +98,7 @@ func (handler *ResourceConsumerHandler) handleConsumeCPU(w http.ResponseWriter,
}
func (handler *ResourceConsumerHandler) handleConsumeMem(w http.ResponseWriter, query url.Values) {
// geting string data for consumeMem
// getting string data for consumeMem
durationSecString := query.Get(DurationSecQuery)
megabytesString := query.Get(MegabytesQuery)
if durationSecString == "" || megabytesString == "" {
@ -153,7 +153,7 @@ func (handler *ResourceConsumerHandler) bumpMetric(metric string, delta float64,
}
func (handler *ResourceConsumerHandler) handleBumpMetric(w http.ResponseWriter, query url.Values) {
// geting string data for handleBumpMetric
// getting string data for handleBumpMetric
metric := query.Get(MetricNameQuery)
deltaString := query.Get(DeltaQuery)
durationSecString := query.Get(DurationSecQuery)