Skip to content

Commit

Permalink
use the helm --namespace convention and drop agones.namespace to foll…
Browse files Browse the repository at this point in the history
…ow helm standard.
  • Loading branch information
Cyril TOVENA committed Jun 10, 2018
1 parent a323222 commit fb229cb
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 81 deletions.
4 changes: 2 additions & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ install: ALWAYS_PULL_SIDECAR := true
install: IMAGE_PULL_POLICY := "Always"
install: ensure-build-image
docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) \
helm upgrade --install --namespace=default \
helm upgrade --install --namespace=agones-system \
--set agones.image.tag=$(VERSION),agones.image.registry=$(REGISTRY),agones.image.controller.pullPolicy=$(IMAGE_PULL_POLICY),agones.image.sdk.alwaysPull=$(ALWAYS_PULL_SIDECAR) \
agones $(mount_path)/install/helm/agones/

Expand Down Expand Up @@ -176,7 +176,7 @@ push-agones-sdk-image: ensure-build-image
# Generate the static install script
gen-install: ensure-build-image
docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) bash -c \
'helm template --name=agones-manual $(mount_path)/install/helm/agones \
'helm template --name=agones-manual --namespace agones-system $(mount_path)/install/helm/agones \
--set agones.controller.generateTLS=false \
> $(mount_path)/install/yaml/install.yaml'

Expand Down
11 changes: 6 additions & 5 deletions install/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ Download the latest `agones-install` zip from the [releases](https://github.com/
$ wget https://github.com/GoogleCloudPlatform/agones/releases/download/v0.2.0/agones-install-0.2.0.zip
$ unzip agones-install-0.2.0.zip
$ cd install/helm/
$ helm install --name my-release agones
$ helm install --name my-release --namespace agones-system 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.

_We recommend to install Agones in its own namespaces (like `agones-system` as shown above)
you can use the helm `--namespace` parameter to specify a different namespace._

> **Tip**: List all releases using `helm list`
Expand All @@ -37,7 +39,7 @@ For example to use `default` **and** `xbox` namespaces:

```bash
$ kubectl create namespace xbox
$ helm install --set "gameservers.namespaces={default,xbox}"--name my-release agones
$ helm install --set "gameservers.namespaces={default,xbox}" --namespace agones-system --name my-release agones
```

> You need to create your namespaces before installing Agones.
Expand Down Expand Up @@ -74,7 +76,6 @@ The following tables lists the configurable parameters of the Agones chart and t
| Parameter | Description | Default |
| ------------------------------------ | ----------------------------------------------------------------| ---------------------------|
| `agones.rbacEnabled` | Creates RBAC resources. Must be set for any cluster configured with RBAC | `true` |
| `agones.namespace` | Namespace to use to deploy Agones | `agones-system` |
| `agones.serviceaccount.controller` | Service account name for the controller | `agones-controller` |
| `agones.serviceaccount.sdk` | Service account name for the sdk | `agones-sdk` |
| `agones.image.registry` | Global image registry for all images | `gcr.io/agones-images` |
Expand All @@ -97,7 +98,7 @@ The following tables lists the configurable parameters of the Agones chart and t
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```bash
$ helm install --name my-release \
$ helm install --name my-release --namespace agones-system \
--set agones.namespace=mynamespace,gameservers.minPort=1000,gamesevers.maxPort=5000 agones
```

Expand All @@ -106,7 +107,7 @@ The above command sets the namespace where Agones is deployed to `mynamespace`.
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
$ helm install --name my-release --namespace agones-system -f values.yaml agones
```

> **Tip**: You can use the default [values.yaml](agones/values.yaml)
Expand Down
4 changes: 2 additions & 2 deletions install/helm/agones/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The Agones controller has been installed in the namespace {{ .Values.agones.namespace }}.
The Agones controller has been installed in the namespace {{ .Release.Namespace }}.

You can watch the status by running 'kubectl --namespace {{ .Values.agones.namespace }} get pods -o wide -w {{ .Values.agones.serviceaccount.controller }}'
You can watch the status by running 'kubectl --namespace {{ .Release.Namespace }} get pods -o wide -w {{ .Values.agones.serviceaccount.controller }}'

Once ready you can create your first GameServer using our examples:

Expand Down
11 changes: 4 additions & 7 deletions install/helm/agones/templates/admissionregistration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@
# limitations under the License.
{{- $ca := genCA "admission-controller-ca" 3650 }}
{{- $cn := printf "agones-controller-service" }}
{{- $altName1 := printf "agones-controller-service.%s" .Values.agones.namespace }}
{{- $altName2 := printf "agones-controller-service.%s.svc" .Values.agones.namespace }}
{{- $altName1 := printf "agones-controller-service.%s" .Release.Namespace }}
{{- $altName2 := printf "agones-controller-service.%s.svc" .Release.Namespace }}
{{- $cert := genSignedCert $cn nil (list $altName1 $altName2) 3650 $ca }}
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
name: agones-validation-webhook
namespace: {{ .Values.agones.namespace }}
webhooks:
- name: validations.stable.agones.dev
failurePolicy: Fail
clientConfig:
service:
name: agones-controller-service
namespace: {{ .Values.agones.namespace }}
namespace: {{ .Release.Namespace }}
path: /validate
{{- if .Values.agones.controller.generateTLS }}
caBundle: {{ b64enc $ca.Cert }}
Expand Down Expand Up @@ -59,7 +58,6 @@ apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
name: agones-mutation-webhook
namespace: {{ .Values.agones.namespace }}
labels:
component: controller
app: {{ template "agones.name" . }}
Expand All @@ -72,7 +70,7 @@ webhooks:
clientConfig:
service:
name: agones-controller-service
namespace: {{ .Values.agones.namespace }}
namespace: {{ .Release.Namespace }}
path: /mutate
{{- if .Values.agones.controller.generateTLS }}
caBundle: {{ b64enc $ca.Cert }}
Expand All @@ -95,7 +93,6 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ template "agones.fullname" . }}-cert
namespace: {{ .Values.agones.namespace }}
labels:
app: {{ template "agones.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Expand Down
1 change: 0 additions & 1 deletion install/helm/agones/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: agones-controller
namespace: {{ .Values.agones.namespace}}
labels:
component: controller
app: {{ template "agones.name" . }}
Expand Down
23 changes: 0 additions & 23 deletions install/helm/agones/templates/namespace.yaml

This file was deleted.

1 change: 0 additions & 1 deletion install/helm/agones/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: v1
kind: Service
metadata:
name: agones-controller-service
namespace: {{ .Values.agones.namespace }}
labels:
component: controller
app: {{ template "agones.name" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.agones.serviceaccount.controller }}
namespace: {{ .Values.agones.namespace }}
labels:
app: {{ template "agones.name" . }}
chart: {{ template "agones.chart" . }}
Expand All @@ -28,7 +27,6 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Values.agones.serviceaccount.controller }}
namespace: {{ .Values.agones.namespace }}
labels:
app: {{ template "agones.name" . }}
chart: {{ template "agones.chart" . }}
Expand Down Expand Up @@ -58,15 +56,14 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Values.agones.serviceaccount.controller }}-access
namespace: {{ .Values.agones.namespace }}
labels:
app: {{ template "agones.name" . }}
chart: {{ template "agones.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
subjects:
- kind: User
name: system:serviceaccount:{{ .Values.agones.namespace }}:{{ .Values.agones.serviceaccount.controller }}
name: system:serviceaccount:{{ .Release.Namespace }}:{{ .Values.agones.serviceaccount.controller }}
apiGroup: rbac.authorization.k8s.io
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
1 change: 0 additions & 1 deletion install/helm/agones/templates/serviceaccounts/sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Values.agones.serviceaccount.sdk }}
namespace: {{ .Values.agones.namespace }}
labels:
app: {{ template "agones.name" . }}
chart: {{ template "agones.chart" . }}
Expand Down
1 change: 0 additions & 1 deletion install/helm/agones/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# Declare variables to be passed into your templates.

agones:
namespace: agones-system
rbacEnabled: true
serviceaccount:
controller: agones-controller
Expand Down
34 changes: 0 additions & 34 deletions install/yaml/install.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
---
# Source: agones/templates/namespace.yaml
# Copyright 2018 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
kind: Namespace
metadata:
name: agones-system
labels:
app: agones
chart: agones-0.2.0
release: agones-manual
heritage: Tiller
---
# Source: agones/templates/serviceaccounts/controller.yaml
# Copyright 2018 Google Inc. All Rights Reserved.
#
Expand All @@ -43,7 +18,6 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: agones-controller
namespace: agones-system
labels:
app: agones
chart: agones-0.2.0
Expand All @@ -54,7 +28,6 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: agones-controller
namespace: agones-system
labels:
app: agones
chart: agones-0.2.0
Expand Down Expand Up @@ -84,7 +57,6 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: agones-controller-access
namespace: agones-system
labels:
app: agones
chart: agones-0.2.0
Expand Down Expand Up @@ -129,7 +101,6 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: agones-sdk
namespace: agones-system
labels:
app: agones
chart: agones-0.2.0
Expand Down Expand Up @@ -642,7 +613,6 @@ apiVersion: v1
kind: Service
metadata:
name: agones-controller-service
namespace: agones-system
labels:
component: controller
app: agones
Expand Down Expand Up @@ -675,7 +645,6 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: agones-controller
namespace: agones-system
labels:
component: controller
app: agones
Expand Down Expand Up @@ -748,7 +717,6 @@ apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
name: agones-validation-webhook
namespace: agones-system
webhooks:
- name: validations.stable.agones.dev
failurePolicy: Fail
Expand Down Expand Up @@ -782,7 +750,6 @@ apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
name: agones-mutation-webhook
namespace: agones-system
labels:
component: controller
app: agones
Expand Down Expand Up @@ -814,7 +781,6 @@ apiVersion: v1
kind: Secret
metadata:
name: agones-manual-cert
namespace: agones-system
labels:
app: agones-manual
chart: "agones-0.2.0"
Expand Down

0 comments on commit fb229cb

Please sign in to comment.