Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
templarfelix committed Apr 12, 2024
1 parent 6ac5fa5 commit fa95983
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 2 deletions.
14 changes: 14 additions & 0 deletions _docs/dayz.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ https://github.com/GameServerManagers/Game-Server-Configs/blob/main/dayz/server.
hostname = "SERVERNAME";
passwordAdmin = "ADMINPASSWORD";

### How create steam login for gameserve operator

> tip: to make it easier to use, create a new steam login just for the operator and disable steamguard.

https://docs.linuxgsm.com/steamcmd#steam-user-login

## Kubernetes gameserver Dayz kind

> Please Generate a GCP OR AWS public ip and use in **loadBalancerIP**
Expand All @@ -37,6 +44,13 @@ metadata:
spec:
storage: 10G
#loadBalancerIP: your ipv4 public ip 0.0.0.0
resources:
requests:
memory: 8Gi
cpu: 4
limits:
memory: 16Gi
cpu: 8
ports:
- name: port-27015-tcp
port: 27015
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ type Base struct {
LoadBalancerIP string `json:"loadBalancerIP,omitempty"`

Ports []corev1.ServicePort `json:"ports"`

Resources corev1.ResourceRequirements `json:"resources"`
}
49 changes: 49 additions & 0 deletions config/crd/bases/gameserver.templarfelix.com_dayzs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,61 @@ spec:
- port
type: object
type: array
resources:
description: ResourceRequirements describes the compute resource requirements.
properties:
claims:
description: "Claims lists the names of resources, defined in
spec.resourceClaims, that are used by this container. \n This
is an alpha field and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable. It can only be set
for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims
of the Pod where this field is used. It makes that resource
available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute resources
allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified, otherwise
to an implementation-defined value. Requests cannot exceed Limits.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
storage:
default: 10G
type: string
required:
- image
- ports
- resources
type: object
status:
description: DayzStatus defines the observed state of Dayz
Expand Down
7 changes: 7 additions & 0 deletions config/samples/gameserver_v1alpha1_dayz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ metadata:
spec:
storage: 10G
#loadBalancerIP: your ipv4 public ip 0.0.0.0
resources:
requests:
memory: 8Gi
cpu: 4
limits:
memory: 16Gi
cpu: 8
ports:
- name: port-27015-tcp
port: 27015
Expand Down
5 changes: 3 additions & 2 deletions internal/controller/dayz_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ func (r *DayzReconciler) reconcileDeployment(ctx context.Context, instance *game
},
Containers: []corev1.Container{
{
Name: "server",
Image: instance.Spec.Image,
Name: "server",
Image: instance.Spec.Image,
Resources: instance.Spec.Resources,
Ports: []corev1.ContainerPort{
{
ContainerPort: 2302,
Expand Down

0 comments on commit fa95983

Please sign in to comment.