Skip to content

Commit

Permalink
Helm charts for open-match, prometheus, and grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyje committed Mar 7, 2019
1 parent 7a7b1cb commit 67d4965
Show file tree
Hide file tree
Showing 19 changed files with 817 additions and 0 deletions.
23 changes: 23 additions & 0 deletions install/helm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Open Match Helm Chart
=====================

Open Match provides a Helm chart to quickly

```bash
# Install Helm and Tiller
# See https://github.com/helm/helm/releases for
cd /tmp && curl -Lo helm.tar.gz https://storage.googleapis.com/kubernetes-helm/helm-v2.13.0-linux-amd64.tar.gz && tar xvzf helm.tar.gz --strip-components 1 && mv helm $(PREFIX)/bin/helm && mv tiller $(PREFIX)/bin/tiller

# Install Helm to Kubernetes Cluster
kubectl create serviceaccount --namespace kube-system tiller
helm init --service-account tiller --force-upgrade
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
# Run if RBAC is enabled.
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

# Deploy Open Match
helm upgrade --install --wait --debug open-match install/helm/open-match \
--namespace=open-match \
--set openmatch.image.registry=gcr.io/open-match-public-images \
--set openmatch.image.tag=0.4.0
```
36 changes: 36 additions & 0 deletions install/helm/open-match/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2019 Google Inc. All Rights Reserved.
#
# 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
appVersion: "0.4.0"
version: 0.4.0
name: open-match
description: Flexible, extensible, and scalable video game matchmaking.
keywords:
- kubernetes
- game-development
- multiplayer
- matchmaking
- go
- golang
home: https://github.com/GoogleCloudPlatform/open-match
sources:
- https://github.com/GoogleCloudPlatform/open-match
maintainers:
- name: open-match
email: open-match-discuss@googlegroups.com
url: https://groups.google.com/forum/#!forum/open-match-discuss
engine: gotpl
#icon: https://github.com/GoogleCloudPlatform/open-match/raw/master/docs/open-match.png
tillerVersion: ">2.10.0"
12 changes: 12 additions & 0 deletions install/helm/open-match/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Install Open Match using Helm

This chart installs the Open Match application and defines deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

To deploy this chart run:

```bash
helm upgrade --install --wait --debug open-match install/helm/open-match \
--namespace=open-match \
--set openmatch.image.registry=$(REGISTRY) \
--set openmatch.image.tag=$(TAG)
```
Binary file added install/helm/open-match/charts/grafana-2.2.0.tgz
Binary file not shown.
Binary file not shown.
Binary file added install/helm/open-match/charts/redis-6.1.0.tgz
Binary file not shown.
1 change: 1 addition & 0 deletions install/helm/open-match/config/matchmaker_config.yaml
15 changes: 15 additions & 0 deletions install/helm/open-match/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dependencies:
- name: prometheus
repository: https://kubernetes-charts.storage.googleapis.com/
version: 8.7.1
- name: redis
repository: https://kubernetes-charts.storage.googleapis.com/
version: 6.1.0
- name: prometheus-operator
repository: https://kubernetes-charts.storage.googleapis.com/
version: 4.1.1
- name: grafana
repository: https://kubernetes-charts.storage.googleapis.com/
version: 2.2.0
digest: sha256:c05b47c666cfaf02c20f9e98761e4a822e5e3da3a8260ab7e9fa61176bb65538
generated: 2019-02-28T07:29:16.776303908-08:00
29 changes: 29 additions & 0 deletions install/helm/open-match/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2019 Google Inc. All Rights Reserved.
#
# 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.

# TIP: Find versions via `gsutil ls gs://kubernetes-charts`

dependencies:
- name: prometheus
version: 8.7.1
repository: https://kubernetes-charts.storage.googleapis.com/
condition: prometheus.enabled
- name: redis
version: 6.1.0
repository: https://kubernetes-charts.storage.googleapis.com/
condition: redis.enabled
- name: grafana
version: 2.2.0
repository: https://kubernetes-charts.storage.googleapis.com/
condition: grafana.enabled
11 changes: 11 additions & 0 deletions install/helm/open-match/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The Open Match has been installed in the namespace {{ .Release.Namespace }}.

You can watch the status by running 'kubectl --namespace {{ .Release.Namespace }} get pods,svc'

Finally don't forget to explore our documentation and usage guides on how to develop Open Match match making functions:

- [Matchmaking Logic (MMLogic) API
](https://github.com/GoogleCloudPlatform/open-match#matchmaking-logic-mmlogic-api)
- [Go Example](https://github.com/GoogleCloudPlatform/open-match/tree/master/examples/functions/golang/manual-simple)
- [Python3 Example](https://github.com/GoogleCloudPlatform/open-match/tree/master/examples/functions/python3/mmlogic-simple)

48 changes: 48 additions & 0 deletions install/helm/open-match/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{*
Copyright 2019 Google Inc. All Rights Reserved.
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.
*}

{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "openmatch.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "openmatch.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "openmatch.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
98 changes: 98 additions & 0 deletions install/helm/open-match/templates/backendapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Copyright 2019 Google Inc. All Rights Reserved.
#
# 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.

{{- if .Values.openmatch.backendapi.install }}
---
kind: Service
apiVersion: v1
metadata:
name: om-backendapi
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "openmatch.name" . }}
chart: {{ template "openmatch.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
app: {{ template "openmatch.name" . }}
component: backend
ports:
- name: grpc
protocol: TCP
port: {{ .Values.openmatch.backendapi.grpc.port }}
targetPort: grpc
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: om-backendapi
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "openmatch.name" . }}
component: backend
chart: {{ template "openmatch.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ template "openmatch.name" . }}
component: backend
chart: {{ template "openmatch.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
template:
namespace: {{ .Release.Namespace }}
metadata:
annotations:
{{- if and (.Values.openmatch.metrics.prometheusServiceDiscovery) (.Values.openmatch.metrics.prometheusEnabled) }}
prometheus.io/scrape: "true"
prometheus.io/port: {{ .Values.openmatch.metrics.port | quote }}
prometheus.io/path: {{ .Values.openmatch.metrics.path }}
{{- end }}
labels:
app: {{ template "openmatch.name" . }}
component: backend
chart: {{ template "openmatch.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
containers:
- name: om-backend
image: "{{ .Values.openmatch.image.registry }}/{{ .Values.openmatch.image.backendapi.name}}:{{ .Values.openmatch.image.tag }}"
imagePullPolicy: {{ .Values.openmatch.image.backendapi.pullPolicy }}
volumeMounts:
- name: om-config-volume
mountPath: {{ .Values.openmatch.config.matchmaker }}
ports:
- name: grpc
containerPort: {{ .Values.openmatch.backendapi.grpc.port }}
- name: metrics
containerPort: {{ .Values.openmatch.metrics.port }}
resources:
requests:
memory: 100Mi
cpu: 100m
env:
- name: REDIS_SERVICE_HOST
value: "$(OPEN_MATCH_REDIS_MASTER_SERVICE_HOST)"
- name: REDIS_SERVICE_PORT
value: "$(OPEN_MATCH_REDIS_MASTER_SERVICE_PORT)"
volumes:
- name: om-config-volume
configMap:
name: om-configmap
{{- end }}
98 changes: 98 additions & 0 deletions install/helm/open-match/templates/frontendapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Copyright 2019 Google Inc. All Rights Reserved.
#
# 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.

{{- if .Values.openmatch.frontendapi.install }}
---
kind: Service
apiVersion: v1
metadata:
name: om-frontendapi
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "openmatch.name" . }}
chart: {{ template "openmatch.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
app: {{ template "openmatch.name" . }}
chart: {{ template "openmatch.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: frontend
ports:
- name: grpc
protocol: TCP
port: {{ .Values.openmatch.frontendapi.grpc.port }}
targetPort: grpc
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: om-frontendapi
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "openmatch.name" . }}
chart: {{ template "openmatch.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: frontend
spec:
replicas: 1
selector:
matchLabels:
app: {{ template "openmatch.name" . }}
component: frontend
template:
namespace: {{ .Release.Namespace }}
metadata:
annotations:
{{- if and (.Values.openmatch.metrics.prometheusServiceDiscovery) (.Values.openmatch.metrics.prometheusEnabled) }}
prometheus.io/scrape: "true"
prometheus.io/port: {{ .Values.openmatch.metrics.port | quote }}
prometheus.io/path: {{ .Values.openmatch.metrics.path }}
{{- end }}
labels:
app: {{ template "openmatch.name" . }}
chart: {{ template "openmatch.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: frontend
spec:
containers:
- name: om-frontendapi
image: "{{ .Values.openmatch.image.registry }}/{{ .Values.openmatch.image.frontendapi.name}}:{{ .Values.openmatch.image.tag }}"
imagePullPolicy: {{ .Values.openmatch.image.frontendapi.pullPolicy }}
volumeMounts:
- name: om-config-volume
mountPath: {{ .Values.openmatch.config.matchmaker }}
ports:
- name: grpc
containerPort: {{ .Values.openmatch.frontendapi.grpc.port }}
- name: metrics
containerPort: {{ .Values.openmatch.metrics.port }}
resources:
requests:
memory: 100Mi
cpu: 100m
env:
- name: REDIS_SERVICE_HOST
value: "$(OPEN_MATCH_REDIS_MASTER_SERVICE_HOST)"
- name: REDIS_SERVICE_PORT
value: "$(OPEN_MATCH_REDIS_MASTER_SERVICE_PORT)"
volumes:
- name: om-config-volume
configMap:
name: om-configmap
{{- end }}
Loading

0 comments on commit 67d4965

Please sign in to comment.