Templatize stress test configurations (#1019)

* Templatize stress test configurations

* Update

* presubmit
This commit is contained in:
yfei1
2019-12-17 11:02:22 -08:00
committed by GitHub
parent b78d4672a6
commit 8db449b307
6 changed files with 377 additions and 45 deletions

View File

@ -339,7 +339,7 @@ install-demo: build/toolchain/bin/helm$(EXE_EXTENSION)
# install-large-chart will install open-match-core, open-match-demo with the demo evaluator and mmf, and telemetry supports.
install-large-chart: install-chart-prerequisite install-demo build/toolchain/bin/helm$(EXE_EXTENSION) install/helm/open-match/secrets/
$(HELM) upgrade $(OPEN_MATCH_HELM_NAME) $(HELM_UPGRADE_FLAGS) install/helm/open-match $(HELM_IMAGE_FLAGS) \
$(HELM) upgrade $(OPEN_MATCH_HELM_NAME) $(HELM_UPGRADE_FLAGS) --atomic install/helm/open-match $(HELM_IMAGE_FLAGS) \
--set open-match-telemetry.enabled=true \
--set open-match-customize.enabled=true \
--set open-match-customize.evaluator.enabled=true \
@ -349,13 +349,13 @@ install-large-chart: install-chart-prerequisite install-demo build/toolchain/bin
# install-chart will install open-match-core, open-match-demo, with the demo evaluator and mmf.
install-chart: install-chart-prerequisite install-demo build/toolchain/bin/helm$(EXE_EXTENSION) install/helm/open-match/secrets/
$(HELM) upgrade $(OPEN_MATCH_HELM_NAME) $(HELM_UPGRADE_FLAGS) install/helm/open-match $(HELM_IMAGE_FLAGS) \
$(HELM) upgrade $(OPEN_MATCH_HELM_NAME) $(HELM_UPGRADE_FLAGS) --atomic install/helm/open-match $(HELM_IMAGE_FLAGS) \
--set open-match-customize.enabled=true \
--set open-match-customize.evaluator.enabled=true
# install-scale-chart will wait for installing open-match-core with telemetry supports then install open-match-scale chart.
install-scale-chart: install-chart-prerequisite build/toolchain/bin/helm$(EXE_EXTENSION) install/helm/open-match/secrets/
$(HELM) upgrade $(OPEN_MATCH_HELM_NAME) $(HELM_UPGRADE_FLAGS) install/helm/open-match $(HELM_IMAGE_FLAGS) \
$(HELM) upgrade $(OPEN_MATCH_HELM_NAME) $(HELM_UPGRADE_FLAGS) --atomic install/helm/open-match $(HELM_IMAGE_FLAGS) -f install/helm/open-match/values-production.yaml \
--set open-match-telemetry.enabled=true \
--set open-match-customize.enabled=true \
--set open-match-customize.function.enabled=true \

View File

@ -43,9 +43,7 @@ prometheus.io/path: {{ .prometheus.endpoint }}
{{- define "openmatch.container.common" -}}
imagePullPolicy: {{ .Values.global.image.pullPolicy }}
resources:
requests:
memory: 100Mi
cpu: 100m
{{- toYaml .Values.global.kubernetes.resources | nindent 2 }}
{{- end -}}
{{- define "openmatch.volumemounts.configs" -}}
@ -118,7 +116,7 @@ readinessProbe:
{{- end -}}
{{- define "openmatch.HorizontalPodAutoscaler.spec.common" -}}
minReplicas: 1
maxReplicas: 50
targetCPUUtilizationPercentage: 80
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.minReplicas }}
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.targetCPUUtilizationPercentage }}
{{- end -}}

View File

@ -88,10 +88,10 @@ data:
passwordPath: {{ .Values.redis.secretMountPath }}/redis-password
{{- end }}
pool:
maxIdle: 200
maxActive: 0
idleTimeout: 60s
healthCheckTimeout: 100ms
maxIdle: {{ index .Values "open-match-core" "redis" "pool" "maxIdle" }}
maxActive: {{ index .Values "open-match-core" "redis" "pool" "maxActive" }}
idleTimeout: {{ index .Values "open-match-core" "redis" "pool" "idleTimeout" }}
healthCheckTimeout: {{ index .Values "open-match-core" "redis" "pool" "healthCheckTimeout" }}
ignoreLists:
ttl: {{ .Values.redis.ignoreLists.ttl }}
expiration: 43200

View File

@ -0,0 +1,278 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Default values for open-match.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
# Open Match Cluster Config
# The configurations defined here will be applied when deploying Open Match to a Kubernetes cluster.
# You may choose to override these values to tailor Open Match for your needs.
#
# Begins the configuration section for `mmlogic` component in Open Match.
# mmlogic:
#
# # Specifies om-mmlogic as the in-cluster domain name for the `mmlogic` service.
# hostName: om-mmlogic
#
# # Specifies the port for receiving RESTful HTTP requests in the `mmlogic` service.
# # Checkouts https://open-match.dev/site/swaggerui/index.html for the RESTful APIs Open Match provides.
# httpPort: 51503
#
# # Specifies the port for receiving gRPC calls in the `mmlogic` service.
# # Note that some services may not have grpcPort defined as they don't have gRPC APIs defined.
# grpcPort: 50503
#
# # Specifies the port type for the `mmlogic` service, default to ClusterIP - available port types are ClusterIP, NodePort, LoadBalancer, ExternalName.
# # Please see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types for Type values and their behaviors.
# portType: ClusterIP
#
# # Specifies the number of Kubernetes pod replicas per `mmlogic` service, default to 3.
# replicas: 3
#
# # Specifies the image name to be used in a Kubernetes pod for `mmlogic` compoenent.
# image: openmatch-mmlogic
swaggerui: &swaggerui
hostName: om-swaggerui
httpPort: 51500
portType: ClusterIP
replicas: 1
image: openmatch-swaggerui
mmlogic: &mmlogic
hostName: om-mmlogic
grpcPort: 50503
httpPort: 51503
portType: ClusterIP
replicas: 3
image: openmatch-mmlogic
frontend: &frontend
hostName: om-frontend
grpcPort: 50504
httpPort: 51504
portType: ClusterIP
replicas: 3
image: openmatch-frontend
backend: &backend
hostName: om-backend
grpcPort: 50505
httpPort: 51505
portType: ClusterIP
replicas: 3
image: openmatch-backend
synchronizer: &synchronizer
hostName: om-synchronizer
grpcPort: 50506
httpPort: 51506
portType: ClusterIP
replicas: 1
image: openmatch-synchronizer
evaluator: &evaluator
hostName: om-evaluator
grpcPort: 50508
httpPort: 51508
replicas: 3
function: &function
hostName: om-function
grpcPort: 50502
httpPort: 51502
replicas: 3
# Specifies the location and name of the Open Match application-level config volumes.
# Used in template: `openmatch.volumemounts.configs` and `openmatch.volumes.configs` under `templates/_helpers.tpl` file.
configs:
default:
volumeName: om-config-volume-default
mountPath: /app/config/default
configName: om-configmap-default
override:
volumeName: om-config-volume-override
mountPath: /app/config/override
configName: om-configmap-override
# Override Redis settings
# https://hub.helm.sh/charts/stable/redis
# https://github.com/helm/charts/tree/master/stable/redis
redis:
fullnameOverride: om-redis
redisPort: 6379
usePassword: false
usePasswordFile: false
secretMountPath: /opt/bitnami/redis/secrets
ignoreLists:
ttl: 60000ms
configmap:
maxclients 100000
master:
disableCommands: [] # don't disable 'FLUSH-' commands
resources:
requests:
memory: 3Gi
cpu: 3
limits:
memory: 6Gi
cpu: 6
persistence:
enabled: false
metrics:
enabled: true
cluster:
slaveCount: 3
serviceAccount:
create: true
name: open-match-redis-service
slave:
persistence:
enabled: false
resources:
requests:
memory: 1Gi
cpu: 1
limits:
memory: 2Gi
cpu: 2
sysctlImage:
# Enable this setting in production if you are running Open Match under Linux environment
enabled: true
mountHostSys: true
# Redis may require some changes in the kernel of the host machine to work as expected,
# in particular increasing the somaxconn value and disabling transparent huge pages.
# https://github.com/helm/charts/tree/master/stable/redis#host-kernel-settings
command:
- /bin/sh
- -c
- |-
echo never > /host-sys/kernel/mm/transparent_hugepage/enabled # Disable THP support
install_packages procps
sysctl -w net.core.somaxconn=100000
###############################################################################################################################
# Open Match configurations for the subcharts
#
# Open Match uses subcharts to control its `functional granularity`.
# You are able to override configurations in a subchart by having a key-value pair under its corresponding subchart section.
#
# 1. open-match-telemetry: Kubernetes definitions of the integrated monitoring tools along with the core Open Match componenets.
# 2. open-match-customize: Kubernetes definitions of the customizable template to use Open Match with your own MMFs and Evaluator.
# 3. open-match-test: Kubernetes definitions of the load testing tools and end-to-end jobs for Open Match.
###############################################################################################################################
# Controls if users need to install backend, frontend, mmlogic, om-configmap, and swaggerui.
open-match-core:
enabled: true
redis:
pool:
maxIdle: 500
maxActive: 500
idleTimeout: 0
healthCheckTimeout: 300ms
# Controls if users need to install scale testing setup for Open Match.
open-match-scale:
# Switch the value between true/false to turn on/off this subchart
enabled: false
frontend: *frontend
backend: *backend
# Controls if users need to install the monitoring tools in Open Match.
open-match-telemetry:
# Switch the value between true/false to turn on/off this subchart
enabled: false
# Controls if users need to install their own MMFs and Evaluator in Open Match.
open-match-customize:
# Switch the value between true/false to turn on/off this subchart
enabled: false
evaluator: *evaluator
function: *function
mmlogic: *mmlogic
# You can override the evaluator/mmf image
# evaluator:
# image: [YOUR_EVALUATOR_IMAGE]
# function:
# image: [YOUR_MMF_IMAGE]
open-match-test:
# Switch the value between true/false to turn on/off this subchart
enabled: false
mmlogic: *mmlogic
frontend: *frontend
backend: *backend
synchronizer: *synchronizer
# Global configurations that are visible to all subcharts
global:
kubernetes:
horizontalPodAutoScaler:
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 60
resources:
requests:
memory: 1.5Gi
cpu: 1.5
limits:
memory: 3Gi
cpu: 2
# Defines a service account which provides an identity for processes that run in a Pod in Open Match.
serviceAccount: open-match-unprivileged-service
# Use this field if you need to override the port type for all services defined in this chart
service:
portType:
gcpProjectId: "replace_with_your_project_id"
# Defines if Open Match needs to serve secure traffic
tls:
enabled: false
server:
mountPath: /app/secrets/tls/server
rootca:
mountPath: /app/secrets/tls/rootca
logging:
rpc:
enabled: false
# Use this field if you need to override the image registry and image tag for all services defined in this chart
image:
registry: gcr.io/open-match-public-images
tag: 0.0.0-dev
pullPolicy: Always
# Expose the telemetry configurations to all subcharts because prometheus, for example,
# requires pod-level annotation to customize its scrape path.
# See definitions in templates/_helpers.tpl - "prometheus.annotations" section for details
telemetry:
zpages:
enabled: true
jaeger:
enabled: false
samplerFraction: 0.005 # Configures a sampler that samples a given fraction of traces.
agentEndpoint: "open-match-jaeger-agent:6831"
collectorEndpoint: "http://open-match-jaeger-collector:14268/api/traces"
prometheus:
enabled: false
endpoint: "/metrics"
serviceDiscovery: true
stackdriverMetrics:
enabled: false
prefix: "open_match"
zipkin:
enabled: false
endpoint: "/zipkin"
reporterEndpoint: "zipkin"
grafana:
enabled: false
reportingPeriod: "1m"

View File

@ -115,6 +115,8 @@ redis:
maxclients 100000
master:
disableCommands: [] # don't disable 'FLUSH-' commands
resources:
requests: {}
metrics:
enabled: true
cluster:
@ -151,6 +153,12 @@ redis:
# Controls if users need to install backend, frontend, mmlogic, om-configmap, and swaggerui.
open-match-core:
enabled: true
redis:
pool:
maxIdle: 200
maxActive: 0
idleTimeout: 0
healthCheckTimeout: 100ms
# Controls if users need to install scale testing setup for Open Match.
open-match-scale:
@ -188,6 +196,17 @@ open-match-test:
# Global configurations that are visible to all subcharts
global:
kubernetes:
horizontalPodAutoScaler:
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 100Mi
cpu: 100m
# Defines a service account which provides an identity for processes that run in a Pod in Open Match.
serviceAccount: open-match-unprivileged-service
# Use this field if you need to override the port type for all services defined in this chart

View File

@ -123,9 +123,27 @@ message MetricDescriptor {
// Some combinations of `metric_kind` and `value_type` might not be supported.
ValueType value_type = 4;
// The unit in which the metric value is reported. It is only applicable
// if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
// supported units are a subset of [The Unified Code for Units of
// The units in which the metric value is reported. It is only applicable
// if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
// defines the representation of the stored metric values.
//
// Different systems may scale the values to be more easily displayed (so a
// value of `0.02KBy` _might_ be displayed as `20By`, and a value of
// `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
// `KBy`, then the value of the metric is always in thousands of bytes, no
// matter how it may be displayed..
//
// If you want a custom metric to record the exact number of CPU-seconds used
// by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
// `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
// CPU-seconds, then the value is written as `12005`.
//
// Alternatively, if you want a custome metric to record data in a more
// granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
// `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
// or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
//
// The supported units are a subset of [The Unified Code for Units of
// Measure](http://unitsofmeasure.org/ucum.html) standard:
//
// **Basic units (UNIT)**
@ -139,33 +157,40 @@ message MetricDescriptor {
//
// **Prefixes (PREFIX)**
//
// * `k` kilo (10**3)
// * `M` mega (10**6)
// * `G` giga (10**9)
// * `T` tera (10**12)
// * `P` peta (10**15)
// * `E` exa (10**18)
// * `Z` zetta (10**21)
// * `Y` yotta (10**24)
// * `m` milli (10**-3)
// * `u` micro (10**-6)
// * `n` nano (10**-9)
// * `p` pico (10**-12)
// * `f` femto (10**-15)
// * `a` atto (10**-18)
// * `z` zepto (10**-21)
// * `y` yocto (10**-24)
// * `Ki` kibi (2**10)
// * `Mi` mebi (2**20)
// * `Gi` gibi (2**30)
// * `Ti` tebi (2**40)
// * `k` kilo (10^3)
// * `M` mega (10^6)
// * `G` giga (10^9)
// * `T` tera (10^12)
// * `P` peta (10^15)
// * `E` exa (10^18)
// * `Z` zetta (10^21)
// * `Y` yotta (10^24)
// * `m` milli (10^-3)
// * `u` micro (10^-6)
// * `n` nano (10^-9)
// * `p` pico (10^-12)
// * `f` femto (10^-15)
// * `a` atto (10^-18)
// * `z` zepto (10^-21)
// * `y` yocto (10^-24)
// * `Ki` kibi (2^10)
// * `Mi` mebi (2^20)
// * `Gi` gibi (2^30)
// * `Ti` tebi (2^40)
// * `Pi` pebi (2^50)
//
// **Grammar**
//
// The grammar also includes these connectors:
//
// * `/` division (as an infix operator, e.g. `1/s`).
// * `.` multiplication (as an infix operator, e.g. `GBy.d`)
// * `/` division or ratio (as an infix operator). For examples,
// `kBy/{email}` or `MiBy/10ms` (although you should almost never
// have `/s` in a metric `unit`; rates should always be computed at
// query time from the underlying cumulative or delta value).
// * `.` multiplication or composition (as an infix operator). For
// examples, `GBy.d` or `k{watt}.h`.
//
// The grammar for a unit is as follows:
//
@ -180,14 +205,26 @@ message MetricDescriptor {
//
// Notes:
//
// * `Annotation` is just a comment if it follows a `UNIT` and is
// equivalent to `1` if it is used alone. For examples,
// `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
// * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
// is used alone, then the unit is equivalent to `1`. For examples,
// `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
// * `NAME` is a sequence of non-blank printable ASCII characters not
// containing '{' or '}'.
// * `1` represents dimensionless value 1, such as in `1/s`.
// * `%` represents dimensionless value 1/100, and annotates values giving
// a percentage.
// containing `{` or `}`.
// * `1` represents a unitary [dimensionless
// unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
// as in `1/s`. It is typically used when none of the basic units are
// appropriate. For example, "new users per day" can be represented as
// `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
// users). Alternatively, "thousands of page views per day" would be
// represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
// value of `5.3` would mean "5300 page views per day").
// * `%` represents dimensionless value of 1/100, and annotates values giving
// a percentage (so the metric values are typically in the range of 0..100,
// and a metric value `3` means "3 percent").
// * `10^2.%` indicates a metric contains a ratio, typically in the range
// 0..1, that will be multiplied by 100 and displayed as a percentage
// (so a metric value `0.03` means "3 percent").
//
string unit = 5;
// A detailed description of the metric, which can be used in documentation.