Skip to content

Commit

Permalink
Merge branch 'master' into helmCRDS
Browse files Browse the repository at this point in the history
  • Loading branch information
markmandel authored Oct 30, 2018
2 parents 089bf1e + 1c48040 commit 6b63f24
Show file tree
Hide file tree
Showing 68 changed files with 2,099 additions and 399 deletions.
120 changes: 108 additions & 12 deletions CHANGELOG.md

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ This software is currently alpha, and subject to change. Not to be used in produ
- Client SDKs for integration with dedicated game servers to work with Agones.

## Why does this project exist?
For more details on why this project was written, read the
For more details on why this project was written, read the
[announcement blog post](https://cloudplatform.googleblog.com/2018/03/introducing-Agones-open-source-multiplayer-dedicated-game-server-hosting-built-on-Kubernetes.html).

## Requirements
- Kubernetes cluster version 1.9+
- [Minikube](https://github.com/kubernetes/minikube), [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) and [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service/) have been tested
- If you are creating and managing your own Kubernetes cluster, the
[MutatingAdmissionWebhook](https://kubernetes.io/docs/admin/admission-controllers/#mutatingadmissionwebhook-beta-in-19), and
[MutatingAdmissionWebhook](https://kubernetes.io/docs/admin/admission-controllers/#mutatingadmissionwebhook-beta-in-19), and
[ValidatingAdmissionWebhook](https://kubernetes.io/docs/admin/admission-controllers/#validatingadmissionwebhook-alpha-in-18-beta-in-19)
admission controllers are required.
We also recommend following the
Expand All @@ -51,10 +51,15 @@ Documentation and usage guides on how to develop and host dedicated game servers
- [Integrating the Game Server SDK](sdks)
- [GameServer Health Checking](./docs/health_checking.md)
- [Accessing Agones via the Kubernetes API](./docs/access_api.md)
- [Troubleshooting](./docs/troubleshooting.md)

### Tutorials
- [Create an Allocator Service (Go)](./docs/create_allocator_service.md) - Learn to programmatically access Agones via the API

### Reference
- [Game Server Specification](./docs/gameserver_spec.md)
- [Fleet Specification](./docs/fleet_spec.md)
- [Fleet Autoscaler Specification](./docs/fleetautoscaler_spec.md)

### Examples
- [Full GameServer Configuration](./examples/gameserver.yaml)
Expand All @@ -64,6 +69,13 @@ Documentation and usage guides on how to develop and host dedicated game servers
- [CPP Simple](./examples/cpp-simple) (C++) - C++ example that starts up, stays healthy and then shuts down after 60 seconds.
- [Xonotic](./examples/xonotic) - Wraps the SDK around the open source FPS game [Xonotic](http://www.xonotic.org) and hosts it on Agones.

### Advanced
- [Scheduling and Autoscaling](./docs/scheduling_autoscaling.md)
- [Limiting CPU/Memory](./docs/limiting_resources.md)

### Third Party Content
- [Videos and Presentation](./docs/videos_presentations.md)

## Get involved

- [Slack](https://join.slack.com/t/agones/shared_invite/enQtMzE5NTE0NzkyOTk1LWQ2ZmY1Mjc4ZDQ4NDJhOGYxYTY2NTY0NjUwNjliYzVhMWFjYjMxM2RlMjg3NGU0M2E0YTYzNDIxNDMyZGNjMjU)
Expand All @@ -80,7 +92,7 @@ Please read the [contributing](CONTRIBUTING.md) guide for directions on submitti

See the [Developing, Testing and Building Agones](build/README.md) documentation for developing, testing and building Agones from source.

The [Release Process](docs/governance/release_process.md) documentation displays the project's upcoming release calendar and release process.
The [Release Process](docs/governance/release_process.md) documentation displays the project's upcoming release calendar and release process.

Agones is in active development - we would love your help in shaping its future!

Expand Down
31 changes: 19 additions & 12 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#

# base version target. This is usually the next release.
base_version = 0.5.0
base_version = 0.6.0

# agones image release registry
release_registry = gcr.io/agones-images
Expand Down Expand Up @@ -58,10 +58,13 @@ agones_path := $(realpath $(build_path)/..)
kubeconfig_path := $(dir $(KUBECONFIG))
kubeconfig_file := $(notdir $(KUBECONFIG))

helm_path := ~/.helm

agones_package = agones.dev/agones
mount_path = /go/src/$(agones_package)
common_mounts = -v $(build_path)/.config/gcloud:/root/.config/gcloud \
-v $(kubeconfig_path):/root/.kube \
-v $(helm_path):/root/.helm \
-v $(agones_path):$(mount_path)

build_tag = agones-build:$(build_version)
Expand Down Expand Up @@ -188,7 +191,7 @@ build-controller-binary: $(ensure-build-image)
# use LINT_TIMEOUT to manipulate the linter timeout
lint: LINT_TIMEOUT ?= 15m
lint: $(ensure-build-image)
docker run --rm $(common_mounts) -w $(mount_path) $(DOCKER_RUN_ARGS) $(build_tag) bash -c \
docker run -t -e "TERM=xterm-256color" --rm $(common_mounts) -w $(mount_path) $(DOCKER_RUN_ARGS) $(build_tag) bash -c \
"golangci-lint run ./examples/... && golangci-lint run --deadline $(LINT_TIMEOUT) ./..."

# Build the image for the gameserver controller
Expand Down Expand Up @@ -271,6 +274,7 @@ clean-build-image:
ensure-build-config:
-mkdir -p $(kubeconfig_path)
-mkdir -p $(build_path)/.config/gcloud
-mkdir -p $(helm_path)

# create the build image if it doesn't exist
ensure-build-image: ensure-build-config
Expand All @@ -292,11 +296,13 @@ push-build-image:
# generate a changelog using github-changelog-generator
gen-changelog: RELEASE_VERSION ?= $(base_version)
gen-changelog:
@read -p 'Github Token: ' TOKEN && \
docker run -it --rm -v "$(agones_path)":/usr/local/src/your-app ferrarimarco/github-changelog-generator:1.14.3 \
GoogleCloudPlatform/agones --bug-labels=kind/bug --enhancement-labels=kind/feature \
read -p 'Github Token: ' TOKEN && \
docker run -it --rm -v "$(agones_path)":/project markmandel/github-changelog-generator \
--user=GoogleCloudPlatform --project=agones \
--bug-labels=kind/bug --enhancement-labels=kind/feature \
--breaking-labels=kind/breaking --security-labels=area/security \
--future-release "v$(RELEASE_VERSION)" \
--token=$$TOKEN
--token $$TOKEN

# Creates a release. Version defaults to the base_version
# - Checks out a release branch
Expand All @@ -319,7 +325,7 @@ do-release:
cp $(agones_path)/sdks/cpp/bin/agonessdk-$(RELEASE_VERSION)-src.zip $(agones_path)/release
cd $(agones_path) && zip -r ./release/agones-install-$(RELEASE_VERSION).zip ./README.md ./install ./LICENSE
$(MAKE) push-chart
$(MAKE) gcloud-auth-docker push VERSION=$(RELEASE_VERSION)
$(MAKE) gcloud-auth-docker push REGISTRY=$(release_registry) VERSION=$(RELEASE_VERSION)
git push -u upstream release-$(RELEASE_VERSION)
@echo "Now go make the $(RELEASE_VERSION) release on Github!"

Expand Down Expand Up @@ -379,8 +385,10 @@ gcloud-e2e-test-cluster: $(ensure-build-image)
GCP_CLUSTER_NAME=e2e-test-cluster GCP_CLUSTER_ZONE=us-west1-c $(MAKE) gcloud-auth-cluster
docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) \
kubectl apply -f $(mount_path)/build/helm.yaml
docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) helm init --service-account helm --wait && \
helm install --wait --set Replicas=1,uiService.type=ClusterIP --name consul stable/consul
docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) \
helm init --service-account helm --wait
docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) \
helm install --wait --set Replicas=1,uiService.type=ClusterIP --name consul stable/consul

# Deletes the gcloud e2e cluster and cleanup any left pvc volumes
clean-gcloud-e2e-test-cluster: $(ensure-build-image)
Expand Down Expand Up @@ -421,9 +429,8 @@ minikube-test-cluster: DOCKER_RUN_ARGS+=--network=host -v $(minikube_cert_mount)
minikube-test-cluster: $(ensure-build-image) minikube-agones-profile
# localkube bootstrapper fixes issues with profiles
$(MINIKUBE) start --kubernetes-version v1.10.0 --vm-driver $(MINIKUBE_DRIVER) \
--bootstrapper=localkube \
--extra-config=apiserver.Admission.PluginNames=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota \
--extra-config=apiserver.Authorization.Mode=RBAC
--extra-config=apiserver.admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota \
--extra-config=apiserver.authorization-mode=RBAC
# wait until the master is up
until docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) kubectl cluster-info; \
do \
Expand Down
3 changes: 1 addition & 2 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ This will setup a [Minikube](https://github.com/kubernetes/minikube) cluster, ru
Because Minikube runs on a virtualisation layer on the host, some of the standard build and development Make targets
need to be replaced by Minikube specific targets.

> We recommend installing version [0.28.0 of minikube](https://github.com/kubernetes/minikube/releases/tag/v0.28.0),
due to issues with other versions
> We recommend installing version [0.29.0 of minikube](https://github.com/kubernetes/minikube/releases/tag/v0.29.0).
First, [install Minikube](https://github.com/kubernetes/minikube#installation), which may also require you to install
a virtualisation solution, such as [VirtualBox](https://www.virtualbox.org) as well.
Expand Down
7 changes: 3 additions & 4 deletions build/build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN apt-get update && \

# install go
WORKDIR /usr/local
ENV GO_VERSION=1.10.3
ENV GO_VERSION=1.11.1
ENV GOPATH /go
RUN wget -q https://redirector.gvt1.com/edgedl/go/go${GO_VERSION}.linux-amd64.tar.gz && \
tar -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz && mkdir ${GOPATH}
Expand All @@ -49,7 +49,7 @@ RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECT
RUN echo "source <(kubectl completion bash)" >> /root/.bashrc

# install Helm package manager
ENV HELM_VER 2.9.1
ENV HELM_VER 2.11.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 \
Expand All @@ -69,8 +69,7 @@ RUN go get -u github.com/golang/dep/cmd/dep && \
go get -u golang.org/x/tools/cmd/goimports

# install golang-ci linter
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | \
bash -s -- -b $GOPATH/bin v1.10.2
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.10.2

# install the release branch of the code generator tools
RUN mkdir -p /go/src && cd /go/src && mkdir -p k8s.io && cd k8s.io && \
Expand Down
6 changes: 3 additions & 3 deletions build/e2e-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM gcr.io/cloud-builders/gcloud-slim

RUN apt-get update && \
apt-get install -y wget psmisc make python jq zip && \
apt-get install -y wget psmisc make gcc python jq zip && \
apt-get clean

# install go
WORKDIR /usr/local
ENV GO_VERSION=1.10.3
ENV GO_VERSION=1.11.1
ENV GOPATH /go
RUN wget -q https://redirector.gvt1.com/edgedl/go/go${GO_VERSION}.linux-amd64.tar.gz && \
tar -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz && mkdir ${GOPATH}
Expand All @@ -20,7 +20,7 @@ RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECT
mv ./kubectl /usr/local/bin/kubectl

# install Helm package manager
ENV HELM_VER 2.9.1
ENV HELM_VER 2.11.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 \
Expand Down
2 changes: 1 addition & 1 deletion build/e2e-image/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ then
fi
gcloud container clusters get-credentials e2e-test-cluster \
--zone=us-west1-c --project=agones-images
kubectl port-forward statefulset/consul-consul 8500:8500 &
kubectl port-forward statefulset/consul 8500:8500 &
echo "Waiting consul port-forward to launch on 8500..."
timeout 60 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' 127.0.0.1 8500
echo "consul port-forward launched. Starting e2e tests..."
Expand Down
9 changes: 5 additions & 4 deletions build/gke-test-cluster/cluster-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ resources:
cluster:
name: e2e-test-cluster
description: End to end tests cluster for Agones
initialClusterVersion: 1.10.7-gke.1
initialClusterVersion: "1.10"
nodePools:
- name: "default"
initialNodeCount: 2
initialNodeCount: 4
config:
machineType: n1-standard-4
tags:
- game-server
oauthScopes:
- https://www.googleapis.com/auth/devstorage.read_only
- https://www.googleapis.com/auth/compute
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/devstorage.read_only
- https://www.googleapis.com/auth/logging.write
- https://www.googleapis.com/auth/monitoring
- name: game-server-firewall
type: compute.beta.firewall
properties:
Expand Down
7 changes: 4 additions & 3 deletions build/gke-test-cluster/cluster.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resources:
cluster:
name: {{ properties["cluster.name"] }}
description: Test cluster for Agones
initialClusterVersion: 1.10.7-gke.1
initialClusterVersion: "1.10"
nodePools:
- name: "default"
initialNodeCount: {{ properties["cluster.nodePool.initialNodeCount"] }}
Expand All @@ -30,9 +30,10 @@ resources:
tags:
- game-server
oauthScopes:
- https://www.googleapis.com/auth/devstorage.read_only
- https://www.googleapis.com/auth/compute
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/devstorage.read_only
- https://www.googleapis.com/auth/logging.write
- https://www.googleapis.com/auth/monitoring
masterAuth:
username: admin
password: supersecretpassword
Expand Down
Loading

0 comments on commit 6b63f24

Please sign in to comment.