From eed56093eb5607ab67e0acb3e354d5d061ef58b8 Mon Sep 17 00:00:00 2001 From: newhouse Date: Thu, 15 Mar 2018 23:28:12 -0400 Subject: [PATCH] Added Helm support. Now you can deploy agones using ```bash helm install --name my-release agones ``` Note that the build-image Dockerfile was modified to download Helm and add it to the path For more info see the documentation located at `install/helm/README.md` --- build/build-image/Dockerfile | 10 ++ docs/agones.png | Bin 0 -> 9491 bytes docs/installing_agones.md | 18 ++- install/helm/README.md | 80 +++++++++++++ install/helm/agones/Chart.yaml | 20 ++++ install/helm/agones/templates/NOTES.txt | 29 +++++ install/helm/agones/templates/_helpers.tpl | 32 +++++ install/helm/agones/templates/controller.yaml | 48 ++++++++ .../agones/templates/crds/gameserver.yaml | 113 ++++++++++++++++++ .../agones/templates/mutatingwebhook.yaml | 29 +++++ install/helm/agones/templates/namespace.yaml | 9 ++ install/helm/agones/templates/service.yaml | 17 +++ .../templates/serviceaccounts/controller.yaml | 72 +++++++++++ .../agones/templates/serviceaccounts/sdk.yaml | 58 +++++++++ install/helm/agones/values.yaml | 27 +++++ install.yaml => install/yaml/install.yaml | 0 16 files changed, 561 insertions(+), 1 deletion(-) create mode 100644 docs/agones.png create mode 100644 install/helm/README.md create mode 100644 install/helm/agones/Chart.yaml create mode 100644 install/helm/agones/templates/NOTES.txt create mode 100644 install/helm/agones/templates/_helpers.tpl create mode 100644 install/helm/agones/templates/controller.yaml create mode 100644 install/helm/agones/templates/crds/gameserver.yaml create mode 100644 install/helm/agones/templates/mutatingwebhook.yaml create mode 100644 install/helm/agones/templates/namespace.yaml create mode 100644 install/helm/agones/templates/service.yaml create mode 100644 install/helm/agones/templates/serviceaccounts/controller.yaml create mode 100644 install/helm/agones/templates/serviceaccounts/sdk.yaml create mode 100644 install/helm/agones/values.yaml rename install.yaml => install/yaml/install.yaml (100%) diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index 924e38354f..e3d61fbbb3 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -42,6 +42,16 @@ ENV PATH /usr/local/go/bin:/go/bin:/opt/google-cloud-sdk/bin:$PATH RUN gcloud components update && gcloud components install kubectl RUN echo "source <(kubectl completion bash)" >> /root/.bashrc +# install Helm package manager +ENV HELM_VER 2.8.0 +ENV HELM_URL https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VER}-linux-amd64.tar.gz +RUN curl -L ${HELM_URL} > /tmp/helm.tar.gz \ + && tar -zxvf /tmp/helm.tar.gz -C /tmp \ + && mv /tmp/linux-amd64/helm /usr/local/bin/helm \ + && chmod go+rx /usr/local/bin/helm \ + && rm /tmp/helm.tar.gz && rm -rf /tmp/linux-amd64 +RUN echo "source <(helm completion bash)" >> /root/.bashrc + # install go tooling for development, building and testing RUN go get -u github.com/golang/dep/cmd/dep && \ go get -u github.com/alecthomas/gometalinter && \ diff --git a/docs/agones.png b/docs/agones.png new file mode 100644 index 0000000000000000000000000000000000000000..303a4b730a162222b22ec6038149e39d49f4ed6c GIT binary patch literal 9491 zcmeHtcQo8j)b|&`j}!@uL?Vb)mLPhGx(I8D9?=sl(W3`Z5|&7!t+Gm#6(yo2L|LLF z5uz+>iQW=zSN(-WSj)5C=WXY_f4%2Ce?GhCd%kDpJNM4LckbNz%$-RvxvO`cm4_7o zfb%eY9Wwx+BcDG1FwtuIM(1AAUQAAKJssfW^k3LomPV^#d8}_80MLo(oj!DDE__#~ zRWb*{jC7fQ(_dz~PJd_r`V#=)2Vgo{7EdNOX2P>TyLnrG1{<5>>2#NhZp|>n=JwnX ze0Jr$ssHwiJ4Q~mk48G1a#bgA)q1Jfm;U%0`u|?f>CQS!Kg_W9=M4^)-)Zz5E!dKq zCT|sRNk~Ta0U3N}=yKLse*P!V9yYIrA4fO6<7XHi9=6<#R7*aA?UTzYq6!Z0Sp~sp zqW$;pzsv$=oiBhAlc*A_@~}RzwH%B9PL{LY{%k1HEZ61YY^dH<;=F&7_6v0<n(E(SKj&_>6O%g5g!3SkUZ3FMA3#vE0`8YdfSy-Pao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qPkA)aCh;=DDZFuY3e?8nKq>KeO%Gn=&)nS013l~c{S^gaMWAnHIhRjdM+>9 zOw2qs(>6}d%-5#;ri^9?C2R@=o<1xE)BnW}Dk z3`$NLRR=J4mU_DIiXT8=Ie!P22A93&ediFtdV-Rc}N zogTM8M5z5T;4>clbSOOPS7~-a=+1Q8_-IZ`#?n8UkP%vPh5x{cgN%y2iU^x4_*C%3 zXg5|8=E>?DqATVgI#$;+&QWJeGgiq6Z76Xrjo`&4uMdVl8Qmc}7DmLV;I1PHc~g_4 zhp$C;@pi8!ZFc(ZM*`=1i)Y7!O6;mo@0||W^F_rD@e4?nTmrexnn!UodrVzXO!Qt2 zibR#B42NW|zifbRGT&4Nn1)GXf%)8w4Q7OQSyWQ{huL2{leE)mS??`tv8dvx83IIV zv({<=T`8{~Rj=XEJ7T&F^gi6!p5)WxYU?hU>qMlcyIXIK^RASA>^HxS;d>XUHKyxx z7*{;Rc__kV)NsF5{-kw7a?LrL&g8C}VtDXML$$7Oi)BXmKauGE1FfK{r|g-?sJpcFQi$Hvg|9?$1{MF@KwOLPgPPzA@AGReP2Ce&Z8cbVNj$ zF>Ypm+F4+WiI$vG8*1*_JiEAerRT(q@IouBXhvA=A~vGsZT+%F)(^T)cR(c~e31FA zegW#>^A|gjr3Qm%Q5CI1`}}KQqNpe&v#~?R>KyU|EA2KB9}{b-_kAsuyQZ5Rob&06y)o>twbsMaG3SI=nO?uP z*|TM~yl52>RtED8anG?6x#p3VPO`@4`%jpg7B`%peWPytmtErcZ$>l=TqB$?lLa>I V;$li@*PZ|Xrh8YX8v5Y*e*mYdgK_`> literal 0 HcmV?d00001 diff --git a/docs/installing_agones.md b/docs/installing_agones.md index 83c685b185..2153de2be5 100644 --- a/docs/installing_agones.md +++ b/docs/installing_agones.md @@ -17,6 +17,8 @@ In this quickstart, we will create a Kubernetes cluster, and populate it with th 1. [Starting Minikube](#starting-minikube) 1. [Enabling creation of RBAC resources](#enabling-creation-of-rbac-resources) 1. [Installing Agones](#installing-agones) + 1. [Install with yaml](#install-with-yaml) + 1. [Install using Helm](#install-using-helm) 1. [Confirming Agones started successfully](#confirming-agones-started-successfully) 1. [What's next](#whats-next) @@ -175,12 +177,26 @@ kubectl create clusterrolebinding cluster-admin-binding \ # Installing Agones -Finally, we install Agones to the cluster. +This will install Agones in your cluster. + +## Install with YAML + +We can install Agones to the cluster using the [install.yaml file](agones-install-file) + +[agones-install-file]: ../install/yaml/install.yaml ```bash kubectl apply -f https://raw.githubusercontent.com/googlecloudplatform/agones/release-0.1/install.yaml ``` +## Install using Helm + +Also, we can install Agones using [Helm](helm) package manager. If you want more details and configuration +options see the [Helm installation guide for Agones](agones-install-guide) + +[helm]: https://docs.helm.sh +[agones-install-guide]: ../install/helm/README.md + ## Confirming Agones started successfully To confirm Agones is up and running, run the following command: diff --git a/install/helm/README.md b/install/helm/README.md new file mode 100644 index 0000000000..c709eff4f8 --- /dev/null +++ b/install/helm/README.md @@ -0,0 +1,80 @@ +# Install Agones using Helm + +This chart install the Agones application and defines deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +## Prerequisites + +- [Helm](https://docs.helm.sh/helm/) package manager 2.8.0+ +- Kubernetes 1.9+ +- Role-based access controls (RBAC) activated +- MutatingAdmissionWebhook admission controller activated, see [recommendation](https://kubernetes.io/docs/admin/admission-controllers/#is-there-a-recommended-set-of-admission-controllers-to-use) + +## Installing the Chart + +> If you don't have `Helm` installed locally, or `Tiller` installed in your Kubernetes cluster, read the [Using Helm](https://docs.helm.sh/using_helm/) documentation to get started. + +To install the chart with the release name `my-release`: + +```bash +$ cd install/ +$ helm install --name my-release agones +``` + +The command deploys Agones on the Kubernetes cluster with the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. + + +> **Tip**: List all releases using `helm list` + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```bash +$ helm delete my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following tables lists the configurable parameters of the Agones chart and their default values. + +| Parameter | Description | Default | +| ------------------------------------ | ----------------------------------------- | ---------------------------------------------------- | +| `namespace` | Namespace to use for Agones | `agones-system` | +| `serviceaccount.controller` | Service account name for the controller | `agones-controller` | +| `serviceaccount.sdk` | Service account name for the sdk | `agones-sdk` | +| `image.controller.repository` | Image repository for the controller | `gcr.io/agones-images/agones-controller` | +| `image.controller.tag` | Image tag for the controller | `0.1` | +| `image.controller.pullPolicy` | Image pull policy for the controller | `IfNotPresent` | +| `image.sdk.repository` | Image repository for the sdk | `gcr.io/agones-images/agones-sdk` | +| `image.sdk.tag` | Image tag for the sdk | `0.1` | +| `image.sdk.alwaysPull` | Tells if the sdk image should always be pulled | `false` | +| `minPort` | Minimum port to use for dynamic port allocation | `7000` | +| `maxPort` | Maximum port to use for dynamic port allocation | `8000` | +| `healthCheck.http.port` | Port to use for liveness probe service | `8080` | +| `healthCheck.initialDelaySeconds` | Initial delay before performing the first probe (in seconds) | `3` | +| `healthCheck.periodSeconds` | Seconds between every liveness probe (in seconds) | `3` | +| `healthCheck.failureThreshold` | Number of times before giving up (in seconds) | `3` | +| `healthCheck.timeoutSeconds` | Number of seconds after which the probe times out (in seconds) | `1` | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```bash +$ helm install --name my-release \ + --set namespace=mynamespace,minPort=1000,maxPort=5000 agones +``` + +The above command sets the namespace where Agones is deployed to `mynamespace`. Additionally Agones will use a dynamic port allocation range of 1000-5000. + +Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, + +```bash +$ helm install --name my-release -f values.yaml agones +``` + +> **Tip**: You can use the default [values.yaml](agones/values.yaml) + +## Confirm Agones is running + +To confirm Agones is up and running, [go to the next section](../../docs/installing_agones#confirming-agones-started-successfully) \ No newline at end of file diff --git a/install/helm/agones/Chart.yaml b/install/helm/agones/Chart.yaml new file mode 100644 index 0000000000..ef210b8fac --- /dev/null +++ b/install/helm/agones/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +appVersion: "0.1" +version: 0.1.0 +name: agones +description: a library for hosting, running and scaling dedicated game servers on Kubernetes. +keywords: + - go + - golang + - dedicated-gameservers + - multiplayer + - game-development +home: https://agones.dev +sources: + - https://github.com/GoogleCloudPlatform/agones +maintainers: + - name: agones + email: agones-discuss@googlegroups.com + url: https://groups.google.com/forum/#!forum/agones-discuss +engine: gotpl +icon: https://github.com/GoogleCloudPlatform/agones/raw/master/docs/agones.png \ No newline at end of file diff --git a/install/helm/agones/templates/NOTES.txt b/install/helm/agones/templates/NOTES.txt new file mode 100644 index 0000000000..d161e0f4aa --- /dev/null +++ b/install/helm/agones/templates/NOTES.txt @@ -0,0 +1,29 @@ +The Agones controller has been installed in the namespace {{ .Values.namespace }}. + +You can watch the status by running 'kubectl --namespace {{ .Values.namespace }} get pods -o wide -w {{ .Values.serviceaccount.controller }}' + +Once ready you can create your first GameServer using our examples: + +'kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/agones/master/examples/simple-udp/server/gameserver.yaml' + +An example GameServer that makes use of the controller: + +apiVersion: "stable.agones.dev/v1alpha1" +kind: GameServer +metadata: + name: "simple-udp" +spec: + portPolicy: "dynamic" + containerPort: 7654 + template: + spec: + containers: + - name: simple-udp + image: gcr.io/agones-images/udp-server:0.1 + +Finally don't forget to explore our documentation and usage guides on how to develop and host dedicated game servers on top of Agones. : + + - [Create a Game Server](https://github.com/GoogleCloudPlatform/agones/blob/master/docs/create_gameserver.md) + - [Integrating the Game Server SDK](https://github.com/GoogleCloudPlatform/agones/tree/master/sdks) + - [GameServer Health Checking](https://github.com/GoogleCloudPlatform/agones/blob/master/docs/health_checking.md) + - [Accessing Agones via the Kubernetes API](https://github.com/GoogleCloudPlatform/agones/blob/master/docs/access_api.md) \ No newline at end of file diff --git a/install/helm/agones/templates/_helpers.tpl b/install/helm/agones/templates/_helpers.tpl new file mode 100644 index 0000000000..31d4498068 --- /dev/null +++ b/install/helm/agones/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "agones.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 "agones.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 "agones.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/install/helm/agones/templates/controller.yaml b/install/helm/agones/templates/controller.yaml new file mode 100644 index 0000000000..484be8c103 --- /dev/null +++ b/install/helm/agones/templates/controller.yaml @@ -0,0 +1,48 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: agones-controller + namespace: {{ .Values.namespace}} + labels: + component: controller + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + labels: + stable.agones.dev/role: controller + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + spec: + serviceAccountName: {{ .Values.serviceaccount.controller }} + containers: + - name: agones-controller + image: "{{ .Values.image.controller.repository }}:{{ .Values.image.controller.tag }}" + imagePullPolicy: {{ .Values.image.controller.pullPolicy }} + env: + - name: ALWAYS_PULL_SIDECAR # set the sidecar imagePullPolicy to Always + value: {{ .Values.image.sdk.alwaysPull | quote }} + # minimum port that can be exposed to GameServer traffic + - name: MIN_PORT + value: {{ .Values.minPort | quote }} + # maximum port that can be exposed to GameServer traffic + - name: MAX_PORT + value: {{ .Values.maxPort | quote }} + - name: SIDECAR # overwrite the GameServer sidecar image that is used + value: "{{ .Values.image.sdk.repository }}:{{ .Values.image.sdk.tag }}" + livenessProbe: + httpGet: + path: /live + port: {{ .Values.healthCheck.http.port }} + initialDelaySeconds: {{ .Values.healthCheck.initialDelaySeconds }} + periodSeconds: {{ .Values.healthCheck.periodSeconds }} + failureThreshold: {{ .Values.healthCheck.failureThreshold }} + timeoutSeconds: {{ .Values.healthCheck.timeoutSeconds }} \ No newline at end of file diff --git a/install/helm/agones/templates/crds/gameserver.yaml b/install/helm/agones/templates/crds/gameserver.yaml new file mode 100644 index 0000000000..bd6a3ad081 --- /dev/null +++ b/install/helm/agones/templates/crds/gameserver.yaml @@ -0,0 +1,113 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: gameservers.stable.agones.dev + labels: + component: crd + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + group: stable.agones.dev + version: v1alpha1 + scope: Namespaced + names: + kind: GameServer + plural: gameservers + shortNames: + - gs + singular: gameserver + validation: + openAPIV3Schema: + required: + - spec + properties: + spec: + required: + - containerPort + - template + properties: + template: + type: object + required: + - spec + properties: + spec: + type: object + required: + - containers + properties: + containers: + type: array + items: + type: object + required: + - image + properties: + name: + type: string + minLength: 0 + maxLength: 63 + pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + image: + type: string + minLength: 1 + minItems: 1 + container: + title: The container name running the gameserver + description: if there is more than one container, specify which one is the game server + type: string + minLength: 0 + maxLength: 63 + pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + portPolicy: + title: the port policy that will be applied to the game server + description: | + portPolicy has two options: + - "dynamic" (default) the system allocates a free hostPort for the gameserver, for game clients to connect to + - "static", user defines the hostPort that the game client will connect to. Then onus is on the user to ensure that the + port is available. When static is the policy specified, `hostPort` is required to be populated + type: string + enum: + - dynamic + - static + protocol: + title: Protocol being used. Defaults to UDP. TCP is the only other option + type: string + enum: + - UDP + - TCP + containerPort: + title: The port that is being opened on the game server process + type: integer + minimum: 0 + maximum: 65535 + hostPort: + title: The port exposed on the host + description: Only required when `portPolicy` is "static". Overwritten when portPolicy is "dynamic". + type: integer + minimum: 0 + maximum: 65535 + health: + type: object + title: Health checking for the running game server + properties: + disabled: + title: Disable health checking. defaults to false, but can be set to true + type: boolean + initialDelaySeconds: + title: Number of seconds after the container has started before health check is initiated. Defaults to 5 seconds + type: integer + minimum: 0 + maximum: 2147483648 + periodSeconds: + title: How long before the server is considered not healthy + type: integer + minimum: 0 + maximum: 2147483648 + failureThreshold: + title: Minimum consecutive failures for the health probe to be considered failed after having succeeded. + type: integer + minimum: 1 + maximum: 2147483648 \ No newline at end of file diff --git a/install/helm/agones/templates/mutatingwebhook.yaml b/install/helm/agones/templates/mutatingwebhook.yaml new file mode 100644 index 0000000000..492527abcc --- /dev/null +++ b/install/helm/agones/templates/mutatingwebhook.yaml @@ -0,0 +1,29 @@ +apiVersion: admissionregistration.k8s.io/v1beta1 +kind: MutatingWebhookConfiguration +metadata: + name: agones-mutation-webhook + namespace: {{ .Values.namespace }} + labels: + component: controller + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +webhooks: + - name: mutations.stable.agones.dev + failurePolicy: Fail + clientConfig: + service: + name: agones-controller-service + namespace: {{ .Values.namespace }} + path: /mutate + caBundle: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVLVENDQXhHZ0F3SUJBZ0lKQU9KUDY0MTB3dkdTTUEwR0NTcUdTSWIzRFFFQkN3VUFNSUdxTVFzd0NRWUQKVlFRR0V3SlZVek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B2bE12MWptcVVSRldjRVNUTGFRMEZ4NUt3UnlWMHppWm1VdkFBRjJaeApEWmhIVWNvRlBIQXdUbDc1TkFobkhwTWxMTnA1TDd0Y1ZkeVQ4QjJHUnMrc2xRSURBUUFCbzFBd1RqQWRCZ05WCkhRNEVGZ1FVZ3YxblRQYVFKU04zTHFtNWpJalc0eEhtZEcwd0h3WURWUjBqQkJnd0ZvQVVndjFuVFBhUUpTTjMKTHFtNWpJalc0eEhtZEcwd0RBWURWUjBUQkFVd0F3RUIvekFOQmdrcWhraUc5dzBCQVFzRkFBT0NBUUVBSEtFQwprdEVqWU5VQ0ErbXlzejRvclc3cFJVdmhCSERWU2dzWTZlRVZSTHpmLzF5SVpFMHU2NTZrcEs2T1Q3TWhKR2xVCkt3R1NTb1VCQnpWZ1VzWmpEbTdQZ2JrNGlZem40TTF4THpiTFFCcjNNYzV6WEhlZlB2YmltaEQ1NWNMenBWRnUKVlFtQm1aVjJOalU1RHVTZFJuZGxjUGFOY2cvdU9jdlpLNEtZMUtDQkEzRW9BUUlrcHpIWDJpVU1veGlSdlpWTgpORXdnRlR0SUdCWW4wSGZML3ZnT3NIOGZWck1Va3VHMnZoR2RlWEJwWmlxL0JaSmJaZU4yckNmMmdhWDFRSXYwCkVLYmN1RnFNOThXVDVaVlpSdFgxWTNSd2V2ZzRteFlKWEN1SDZGRjlXOS9TejI5NEZ5Mk9CS0I4SkFWYUV4OW4KMS9pNmZJZmZHbkhUWFdIc1ZRPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + rules: + - apiGroups: + - stable.agones.dev + resources: + - "gameservers" + apiVersions: + - "v1alpha1" + operations: + - CREATE \ No newline at end of file diff --git a/install/helm/agones/templates/namespace.yaml b/install/helm/agones/templates/namespace.yaml new file mode 100644 index 0000000000..b7e4b17a10 --- /dev/null +++ b/install/helm/agones/templates/namespace.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.namespace }} + labels: + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} \ No newline at end of file diff --git a/install/helm/agones/templates/service.yaml b/install/helm/agones/templates/service.yaml new file mode 100644 index 0000000000..4d2aa6c484 --- /dev/null +++ b/install/helm/agones/templates/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: agones-controller-service + namespace: {{ .Values.namespace }} + labels: + component: controller + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + selector: + stable.agones.dev/role: controller + ports: + - port: 443 + targetPort: 8081 \ No newline at end of file diff --git a/install/helm/agones/templates/serviceaccounts/controller.yaml b/install/helm/agones/templates/serviceaccounts/controller.yaml new file mode 100644 index 0000000000..e518d52745 --- /dev/null +++ b/install/helm/agones/templates/serviceaccounts/controller.yaml @@ -0,0 +1,72 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceaccount.controller }} + namespace: {{ .Values.namespace }} + labels: + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +secrets: +- name: {{ .Values.serviceaccount.controller }}-secret +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.serviceaccount.controller }}-secret + namespace: {{ .Values.namespace }} + labels: + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + kubernetes.io/service-account.name: {{ .Values.serviceaccount.controller }} +type: kubernetes.io/service-account-token +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Values.serviceaccount.controller }} + namespace: {{ .Values.namespace }} + labels: + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +rules: +- apiGroups: [""] + resources: ["events"] + verbs: ["create"] +- apiGroups: [""] + resources: ["pods"] + verbs: ["create", "delete", "list", "watch"] +- apiGroups: [""] + resources: ["nodes"] + verbs: ["list", "watch"] +- apiGroups: ["apiextensions.k8s.io"] + resources: ["customresourcedefinitions"] + verbs: ["get"] +- apiGroups: ["stable.agones.dev"] + resources: ["gameservers"] + verbs: ["delete", "get", "list", "update", "watch"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Values.serviceaccount.controller }}-access + namespace: {{ .Values.namespace }} + labels: + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +subjects: +- kind: User + name: system:serviceaccount:{{ .Values.namespace }}:{{ .Values.serviceaccount.controller }} + apiGroup: rbac.authorization.k8s.io +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ .Values.serviceaccount.controller }} diff --git a/install/helm/agones/templates/serviceaccounts/sdk.yaml b/install/helm/agones/templates/serviceaccounts/sdk.yaml new file mode 100644 index 0000000000..37aa1441ed --- /dev/null +++ b/install/helm/agones/templates/serviceaccounts/sdk.yaml @@ -0,0 +1,58 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceaccount.sdk }} + labels: + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +secrets: +- name: {{ .Values.serviceaccount.sdk }}-secret +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.serviceaccount.sdk }}-secret + labels: + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + kubernetes.io/service-account.name: {{ .Values.serviceaccount.sdk }} +type: kubernetes.io/service-account-token +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Values.serviceaccount.sdk }} + namespace: {{ .Values.namespace }} + labels: + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +rules: +- apiGroups: ["stable.agones.dev"] + resources: ["gameservers"] + verbs: ["get", "update"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Values.serviceaccount.sdk }}-access + namespace: {{ .Values.namespace }} + labels: + app: {{ template "agones.name" . }} + chart: {{ template "agones.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +subjects: +- kind: User + name: system:serviceaccount:{{ .Values.namespace }}:{{ .Values.serviceaccount.sdk }} + apiGroup: rbac.authorization.k8s.io +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ .Values.serviceaccount.sdk }} \ No newline at end of file diff --git a/install/helm/agones/values.yaml b/install/helm/agones/values.yaml new file mode 100644 index 0000000000..5cc9fb9aea --- /dev/null +++ b/install/helm/agones/values.yaml @@ -0,0 +1,27 @@ +# Declare variables to be passed into your templates. + +namespace: agones-system +serviceaccount: + controller: agones-controller + sdk: agones-sdk + +image: + controller: + repository: gcr.io/agones-images/agones-controller + tag: 0.1 + pullPolicy: IfNotPresent + sdk: + repository: gcr.io/agones-images/agones-sdk + tag: 0.1 + alwaysPull: false + +minPort: 7000 +maxPort: 8000 + +healthCheck: + http: + port: 8080 + initialDelaySeconds: 3 + periodSeconds: 3 + failureThreshold: 3 + timeoutSeconds: 1 diff --git a/install.yaml b/install/yaml/install.yaml similarity index 100% rename from install.yaml rename to install/yaml/install.yaml