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

Consistency: Portpolicy static=>Static & dynamic=>Dynamic #617

Merged
merged 2 commits into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion examples/cpp-simple/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
spec:
ports:
- name: default
portPolicy: "dynamic"
portPolicy: Dynamic
containerPort: 7654
template:
spec:
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp-simple/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
spec:
ports:
- name: default
portPolicy: "dynamic"
portPolicy: Dynamic
containerPort: 7654
template:
spec:
Expand Down
2 changes: 1 addition & 1 deletion examples/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
spec:
ports:
- name: default
portPolicy: "dynamic"
portPolicy: Dynamic
containerPort: 26000
health:
initialDelaySeconds: 30
Expand Down
8 changes: 4 additions & 4 deletions examples/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ spec:
# name is a descriptive name for the port
- name: default
# 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
# - "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
portPolicy: "static"
portPolicy: Dynamic
# the port that is being opened on the game server process
containerPort: 7654
# the port exposed on the host, only required when `portPolicy` is "static". Overwritten when portPolicy is "dynamic".
# the port exposed on the host, only required when `portPolicy` is "Static". Overwritten when portPolicy is "Dynamic".
hostPort: 7777
# protocol being used. Defaults to UDP. TCP is the only other option
protocol: UDP
Expand Down
1 change: 0 additions & 1 deletion examples/rust-simple/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ metadata:
spec:
ports:
- name: default
portPolicy: "dynamic"
containerPort: 7654
template:
spec:
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-udp/dev-gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ metadata:
spec:
ports:
- name: default
portPolicy: "static"
portPolicy: Static
hostPort: 17654
containerPort: 17654
# The following is ignored but required due to validation.
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-udp/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
spec:
ports:
- name: default
portPolicy: "dynamic"
portPolicy: Dynamic
containerPort: 7654
template:
spec:
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-udp/gameserverset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
spec:
ports:
- name: default
portPolicy: "dynamic"
portPolicy: Dynamic
containerPort: 7654
template:
spec:
Expand Down
1 change: 0 additions & 1 deletion examples/xonotic/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ spec:
spec:
ports:
- name: default
portPolicy: "dynamic"
containerPort: 26000
health:
initialDelaySeconds: 30
Expand Down
1 change: 0 additions & 1 deletion examples/xonotic/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ metadata:
spec:
ports:
- name: default
portPolicy: "dynamic"
containerPort: 26000
template:
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ properties:
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
- "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
- Dynamic
- Static
protocol:
title: Protocol being used. Defaults to UDP. TCP is the only other option
type: string
Expand All @@ -87,7 +87,7 @@ properties:
maximum: 65535
hostPort:
title: The port exposed on the host
description: Only required when `portPolicy` is "static". Overwritten when portPolicy is "dynamic".
description: Only required when `portPolicy` is "Static". Overwritten when portPolicy is "dynamic".
type: integer
minimum: 1
maximum: 65535
Expand Down
30 changes: 15 additions & 15 deletions install/yaml/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ spec:
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
- "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
- Dynamic
- Static
protocol:
title: Protocol being used. Defaults to UDP. TCP is the only other option
type: string
Expand All @@ -296,7 +296,7 @@ spec:
maximum: 65535
hostPort:
title: The port exposed on the host
description: Only required when `portPolicy` is "static". Overwritten when portPolicy is "dynamic".
description: Only required when `portPolicy` is "Static". Overwritten when portPolicy is "dynamic".
type: integer
minimum: 1
maximum: 65535
Expand Down Expand Up @@ -590,13 +590,13 @@ spec:
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
- "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
- Dynamic
- Static
protocol:
title: Protocol being used. Defaults to UDP. TCP is the only other option
type: string
Expand All @@ -610,7 +610,7 @@ spec:
maximum: 65535
hostPort:
title: The port exposed on the host
description: Only required when `portPolicy` is "static". Overwritten when portPolicy is "dynamic".
description: Only required when `portPolicy` is "Static". Overwritten when portPolicy is "dynamic".
type: integer
minimum: 1
maximum: 65535
Expand Down Expand Up @@ -884,13 +884,13 @@ spec:
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
- "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
- Dynamic
- Static
protocol:
title: Protocol being used. Defaults to UDP. TCP is the only other option
type: string
Expand All @@ -904,7 +904,7 @@ spec:
maximum: 65535
hostPort:
title: The port exposed on the host
description: Only required when `portPolicy` is "static". Overwritten when portPolicy is "dynamic".
description: Only required when `portPolicy` is "Static". Overwritten when portPolicy is "dynamic".
type: integer
minimum: 1
maximum: 65535
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/stable/v1alpha1/gameserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ const (

// Static PortPolicy means that the user defines the hostPort to be used
// in the configuration.
Static PortPolicy = "static"
Static PortPolicy = "Static"
// Dynamic PortPolicy means that the system will choose an open
// port for the GameServer in question
Dynamic PortPolicy = "dynamic"
Dynamic PortPolicy = "Dynamic"

// RoleLabel is the label in which the Agones role is specified.
// Pods from a GameServer will have the value "gameserver"
Expand Down
1 change: 0 additions & 1 deletion site/content/en/docs/Advanced/limiting-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ metadata:
spec:
ports:
- name: default
portPolicy: "dynamic"
containerPort: 7654
template:
spec:
Expand Down
4 changes: 2 additions & 2 deletions site/content/en/docs/Getting Started/create-fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Spec:
Ports:
Container Port: 7654
Name: default
Port Policy: dynamic
Port Policy: Dynamic
Template:
Metadata:
Creation Timestamp: <nil>
Expand Down Expand Up @@ -305,7 +305,7 @@ status:
- containerPort: 7654
hostPort: 7604
name: default
portPolicy: dynamic
portPolicy: Dynamic
protocol: UDP
template:
metadata:
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/Getting Started/create-gameserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Spec:
Container Port: 7654
Host Port: 7614
Name: default
Port Policy: dynamic
Port Policy: Dynamic
Protocol: UDP
Template:
Metadata:
Expand Down
4 changes: 2 additions & 2 deletions site/content/en/docs/Guides/access-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ $ curl http://localhost:8001/apis/stable.agones.dev/v1alpha1/namespaces/default/
"uid": "692beea6-1e62-11e8-beb2-080027637781"
},
"spec": {
"PortPolicy": "static",
"PortPolicy": "Static",
"container": "simple-udp",
"containerPort": 7654,
"health": {
Expand Down Expand Up @@ -305,7 +305,7 @@ $ curl -d '{"apiVersion":"stable.agones.dev/v1alpha1","kind":"FleetAllocation","
"containerPort": 7654,
"hostPort": 7968,
"name": "default",
"portPolicy": "dynamic",
"portPolicy": "Dynamic",
"protocol": "UDP"
}
],
Expand Down
28 changes: 27 additions & 1 deletion site/content/en/docs/Guides/local-game-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ You can register a local game server with Agones. This means you can run an expe

To register your local game server you'll need to know the IP address of the machine running it and the port. With that you'll create a game server config like the one below.

{{% feature expiryVersion="0.9.0" %}}
```yaml
apiVersion: "stable.agones.dev/v1alpha1"
kind: GameServer
Expand All @@ -34,12 +35,37 @@ spec:
- name: simple-udp
image: gcr.io/agones-images/udp-server:0.5
```
{{% /feature %}}

{{% feature publishVersion="0.9.0" %}}
```yaml
apiVersion: "stable.agones.dev/v1alpha1"
kind: GameServer
metadata:
name: my-local-server
annotations:
# Causes Agones to register your local game server at 192.1.1.2, replace with your server's IP address.
stable.agones.dev/dev-address: "192.1.1.2"
spec:
ports:
- name: default
portPolicy: Static
hostPort: 17654
containerPort: 17654
# The following is ignored but required due to validation.
template:
spec:
containers:
- name: simple-udp
image: gcr.io/agones-images/udp-server:0.5
```
{{% /feature %}}

Once you save this to a file make sure you have `kubectl` configured to point to your Agones cluster and then run `kubectl apply -f dev-gameserver.yaml`. This will register your server with Agones.

Local Game Servers has a few limitations:

* PortPolicy must be static.
* PortPolicy must be {{% feature expiryVersion="0.9.0" %}}`static`{{% /feature %}}{{% feature publishVersion="0.9.0" %}}`Static`{{% /feature %}}.
* The game server is not managed by Agones. Features like autoscaling, replication, etc are not available.

When you are finished working with your server, you can remove the registration with `kubectl delete -f dev-gameserver.yaml`
38 changes: 38 additions & 0 deletions site/content/en/docs/Reference/fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Like any other Kubernetes resource you describe a `Fleet`'s desired state via a

A full `Fleet` specification is available below and in the {{< ghlink href="examples/fleet.yaml" >}}example folder{{< /ghlink >}} for reference :


{{% feature expiryVersion="0.9.0" %}}
```yaml
apiVersion: "stable.agones.dev/v1alpha1"
kind: Fleet
Expand Down Expand Up @@ -43,6 +45,42 @@ spec:
- name: example-server
image: gcr.io/agones/test-server:0.1
```
{{% /feature %}}

{{% feature publishVersion="0.9.0" %}}
```yaml
apiVersion: "stable.agones.dev/v1alpha1"
kind: Fleet
metadata:
name: fleet-example
spec:
replicas: 2
scheduling: Packed
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
foo: bar
spec:
ports:
- name: default
portPolicy: Dynamic
containerPort: 26000
health:
initialDelaySeconds: 30
periodSeconds: 60
template:
spec:
containers:
- name: example-server
image: gcr.io/agones/test-server:0.1
```
{{% /feature %}}


Since Agones defines a new
[Custom Resources Definition (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources/)
Expand Down
Loading