Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the helm --namespace convention #250

Merged
merged 2 commits into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
68 changes: 42 additions & 26 deletions install/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,25 @@ $ 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`
>
---

> If you are installing a development build of Agones (i.e. not the 0.2.0 release), you will need to install Agones the following way:

⚠️⚠️⚠️ **This is currently a development feature and has not been released** ⚠️⚠️⚠️

```bash
$ cd install/helm/
$ helm install --name my-release --namespace agones-system agones --set agones.image.tag=0.3.0-481970d
```

The full list of available tags is [here](https://console.cloud.google.com/gcr/images/agones-images/)

_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._

---

## Namespaces

Expand All @@ -37,7 +54,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 @@ -71,33 +88,32 @@ The command removes all the Kubernetes components associated with the chart and

The following tables lists the configurable parameters of the Agones chart and their default values.

| 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` |
| `agones.image.tag` | Global image tag for all images | `0.2.0` |
| `agones.image.controller.name` | Image name for the controller | `agones-controller` |
| `agones.image.controller.pullPolicy` | Image pull policy for the controller | `IfNotPresent` |
| `agones.image.sdk.name` | Image name for the sdk | `agones-sdk` |
| `agones.image.sdk.alwaysPull` | Tells if the sdk image should always be pulled | `false` |
| `agones.controller.healthCheck.http.port` | Port to use for liveness probe service | `8080` |
| `agones.controller.healthCheck.initialDelaySeconds` | Initial delay before performing the first probe (in seconds) | `3` |
| `agones.controller.healthCheck.periodSeconds` | Seconds between every liveness probe (in seconds) | `3` |
| `agones.controller.healthCheck.failureThreshold` | Number of times before giving up (in seconds) | `3` |
| `agones.controller.healthCheck.timeoutSeconds` | Number of seconds after which the probe times out (in seconds) | `1` |
| `agones.controller.resources` | Controller resource requests/limit | `{}`
| `agones.controller.generateTLS` | Set to true to generate TLS certificates or false to provide your own certificates in `certs/*` | `true`
| `gameservers.namespaces` | a list of namespaces you are planning to use to deploy game servers | `["defaut"]` |
| `gameservers.minPort` | Minimum port to use for dynamic port allocation | `7000` |
| `gameservers.maxPort` | Maximum port to use for dynamic port allocation | `8000` |
| Parameter | Description | Default |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------- |
| `agones.rbacEnabled` | Creates RBAC resources. Must be set for any cluster configured with RBAC | `true` |
| `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` |
| `agones.image.tag` | Global image tag for all images | `0.2.0` |
| `agones.image.controller.name` | Image name for the controller | `agones-controller` |
| `agones.image.controller.pullPolicy` | Image pull policy for the controller | `IfNotPresent` |
| `agones.image.sdk.name` | Image name for the sdk | `agones-sdk` |
| `agones.image.sdk.alwaysPull` | Tells if the sdk image should always be pulled | `false` |
| `agones.controller.healthCheck.http.port` | Port to use for liveness probe service | `8080` |
| `agones.controller.healthCheck.initialDelaySeconds` | Initial delay before performing the first probe (in seconds) | `3` |
| `agones.controller.healthCheck.periodSeconds` | Seconds between every liveness probe (in seconds) | `3` |
| `agones.controller.healthCheck.failureThreshold` | Number of times before giving up (in seconds) | `3` |
| `agones.controller.healthCheck.timeoutSeconds` | Number of seconds after which the probe times out (in seconds) | `1` |
| `agones.controller.resources` | Controller resource requests/limit | `{}` |
| `agones.controller.generateTLS` | Set to true to generate TLS certificates or false to provide your own certificates in `certs/*` | `true` |
| `gameservers.namespaces` | a list of namespaces you are planning to use to deploy game servers | `["defaut"]` |
| `gameservers.minPort` | Minimum port to use for dynamic port allocation | `7000` |
| `gameservers.maxPort` | Maximum port to use for dynamic port allocation | `8000` |

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 +122,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
Loading