Generate static yaml to install open match demo (#969)

* Generate static yaml to install open match demo

* Update Makefile to sync with the latest demo update
This commit is contained in:
yfei1
2019-11-12 22:02:44 -08:00
committed by GitHub
parent 23cc35ae68
commit 580ed235d7
2 changed files with 192 additions and 22 deletions

View File

@ -338,6 +338,13 @@ HELM_UPGRADE_FLAGS = --cleanup-on-fail -i --atomic --no-hooks --debug --timeout=
HELM_TEMPLATE_FLAGS = --no-hooks --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --set usingHelmTemplate=true
HELM_IMAGE_FLAGS = --set global.image.registry=$(REGISTRY) --set global.image.tag=$(TAG)
install-demo: build/toolchain/bin/helm$(EXE_EXTENSION)
cp $(REPOSITORY_ROOT)/install/02-open-match-demo.yaml $(REPOSITORY_ROOT)/install/tmp-demo.yaml
$(SED_REPLACE) 's|gcr.io/open-match-public-images|$(REGISTRY)|g' $(REPOSITORY_ROOT)/install/tmp-demo.yaml
$(SED_REPLACE) 's|0.0.0-dev|$(TAG)|g' $(REPOSITORY_ROOT)/install/tmp-demo.yaml
$(KUBECTL) apply -f $(REPOSITORY_ROOT)/install/tmp-demo.yaml
rm $(REPOSITORY_ROOT)/install/tmp-demo.yaml
# 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_RELEASE_NAME) $(HELM_UPGRADE_FLAGS) install/helm/open-match $(HELM_IMAGE_FLAGS) \
@ -355,17 +362,6 @@ install-chart: install-chart-prerequisite install-demo build/toolchain/bin/helm$
--set open-match-customize.enabled=true \
--set open-match-customize.evaluator.enabled=true
install-demo: OPEN_MATCH_KUBERNETES_NAMESPACE=open-match-demo
install-demo: OPEN_MATCH_RELEASE_NAME=open-match-demo
install-demo: install-chart-prerequisite build/toolchain/bin/helm$(EXE_EXTENSION) install/helm/open-match/secrets/
-$(KUBECTL) create namespace open-match-demo
$(HELM) upgrade $(OPEN_MATCH_RELEASE_NAME) $(HELM_UPGRADE_FLAGS) install/helm/open-match $(HELM_IMAGE_FLAGS) \
--set open-match-core.enabled=false \
--set open-match-demo.enabled=true \
--set open-match-customize.enabled=true \
--set open-match-customize.function.enabled=true \
--set global.kubernetes.serviceAccount=open-match-demo-service
# 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_RELEASE_NAME) $(HELM_UPGRADE_FLAGS) install/helm/open-match $(HELM_IMAGE_FLAGS) \
@ -411,17 +407,11 @@ install/yaml/01-open-match-core.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
$(HELM) template $(OPEN_MATCH_RELEASE_NAME) $(HELM_TEMPLATE_FLAGS) $(HELM_IMAGE_FLAGS) \
install/helm/open-match > install/yaml/01-open-match-core.yaml
install/yaml/02-open-match-demo.yaml: OPEN_MATCH_KUBERNETES_NAMESPACE=open-match-demo
install/yaml/02-open-match-demo.yaml: OPEN_MATCH_RELEASE_NAME=open-match-demo
install/yaml/02-open-match-demo.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template $(OPEN_MATCH_RELEASE_NAME) $(HELM_TEMPLATE_FLAGS) $(HELM_IMAGE_FLAGS) \
--set open-match-core.enabled=false \
--set open-match-demo.enabled=true \
--set open-match-customize.enabled=true \
--set open-match-customize.function.enabled=true \
--set global.kubernetes.serviceAccount=open-match-demo-service \
install/helm/open-match > install/yaml/02-open-match-demo.yaml
cp $(REPOSITORY_ROOT)/install/02-open-match-demo.yaml $(REPOSITORY_ROOT)/install/yaml/02-open-match-demo.yaml
$(SED_REPLACE) 's|0.0.0-dev|$(TAG)|g' $(REPOSITORY_ROOT)/install/yaml/02-open-match-demo.yaml
$(SED_REPLACE) 's|gcr.io/open-match-public-images|$(REGISTRY)|g' $(REPOSITORY_ROOT)/install/yaml/02-open-match-demo.yaml
install/yaml/03-prometheus-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
@ -467,9 +457,7 @@ install/yaml/install.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template $(OPEN_MATCH_RELEASE_NAME) $(HELM_TEMPLATE_FLAGS) $(HELM_IMAGE_FLAGS) \
--set open-match-customize.enabled=true \
--set open-match-customize.function.enabled=true \
--set open-match-customize.evaluator.enabled=true \
--set open-match-demo.enabled=true \
--set open-match-telemetry.enabled=true \
--set global.telemetry.jaeger.enabled=true \
--set global.telemetry.grafana.enabled=true \

View File

@ -0,0 +1,182 @@
# 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.
apiVersion: v1
kind: Namespace
metadata:
name: open-match-demo
labels:
app: open-match-demo
release: open-match-demo
---
apiVersion: v1
kind: ConfigMap
metadata:
name: customize-configmap
namespace: open-match-demo
labels:
app: open-match-customize
component: config
release: open-match-demo
data:
matchmaker_config_default.yaml: |-
api:
functions:
hostname: "om-function"
grpcport: 50502
httpport: 51502
matchmaker_config_override.yaml: |-
api:
mmlogic:
hostname: "om-mmlogic.open-match.svc.cluster.local"
grpcport: "50503"
---
kind: Service
apiVersion: v1
metadata:
name: om-function
namespace: open-match-demo
labels:
app: open-match-customize
component: matchfunction
release: open-match-demo
spec:
selector:
app: open-match-customize
component: matchfunction
release: open-match-demo
clusterIP: None
type: ClusterIP
ports:
- name: grpc
protocol: TCP
port: 50502
- name: http
protocol: TCP
port: 51502
---
kind: Service
apiVersion: v1
metadata:
name: om-demo
namespace: open-match-demo
labels:
app: open-match-demo
component: demo
release: open-match-demo
spec:
selector:
app: open-match-demo
component: demo
type: ClusterIP
ports:
- name: http
protocol: TCP
port: 51507
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: om-function
namespace: open-match-demo
labels:
app: open-match-customize
component: matchfunction
release: open-match-demo
spec:
replicas: 3
selector:
matchLabels:
app: open-match-customize
component: matchfunction
template:
metadata:
namespace: open-match-demo
labels:
app: open-match-customize
component: matchfunction
release: open-match-demo
spec:
volumes:
- name: customize-config-volume
configMap:
name: customize-configmap
- name: om-config-volume-default
configMap:
name: customize-configmap
containers:
- name: om-function
volumeMounts:
- name: customize-config-volume
mountPath: /app/config/override
- name: om-config-volume-default
mountPath: /app/config/default
image: "gcr.io/open-match-public-images/openmatch-mmf-go-soloduel:0.0.0-dev"
ports:
- name: grpc
containerPort: 50502
- name: http
containerPort: 51502
imagePullPolicy: Always
resources:
requests:
memory: 100Mi
cpu: 100m
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: om-demo
namespace: open-match-demo
labels:
app: open-match-demo
component: demo
release: open-match-demo
spec:
replicas: 1
selector:
matchLabels:
app: open-match-demo
component: demo
template:
metadata:
namespace: open-match-demo
labels:
app: open-match-demo
component: demo
release: open-match-demo
spec:
containers:
- name: om-demo
image: "gcr.io/open-match-public-images/openmatch-demo-first-match:0.0.0-dev"
imagePullPolicy: Always
ports:
- name: http
containerPort: 51507
livenessProbe:
httpGet:
scheme: HTTP
path: /healthz
port: 51507
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
scheme: HTTP
path: /healthz?readiness=true
port: 51507
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 2