Skip to content
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
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ up: install-prereqs ## Start the complete development environment
@./cluster/bootstrap.sh
@echo -e "$(BLUE)ℹ️ Deploying Helm releases...$(NC)"
@helmfile sync
@echo -e "$(BLUE)ℹ️ Deploying dummy HTTP server...$(NC)"
@kubectl apply -f manifests/dummy-http-server.yaml
@echo -e "$(BLUE)ℹ️ Creating Velocity forwarding secret...$(NC)"
@./scripts/create-velocity-secret.sh
@echo -e "$(BLUE)ℹ️ Deploying manifests...$(NC)"
@kubectl apply -f manifests
@echo -e "$(BLUE)ℹ️ Waiting for Agones CRDs...$(NC)"
@./scripts/wait-for-crds.sh
@echo -e "$(GREEN)✅ Grounds Development Infrastructure environment is ready!$(NC)"
Expand Down
7 changes: 3 additions & 4 deletions cluster/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ log_success "kubectl context set to k3d-dev"

# Create namespaces
log_info "Creating namespaces..."
for ns in infra databases games api; do
for ns in infra databases games api agones; do
log_info "Creating namespace: ${ns}"
kubectl create namespace "${ns}" --dry-run=client -o yaml | kubectl apply -f -
done
log_success "Namespaces created: infra, databases, games, api"

log_success "Namespaces created: infra, databases, games, api, agones"
# Load .env file if it exists
env_file="${here}/../.env"
if [[ -f "${env_file}" ]]; then
Expand Down Expand Up @@ -107,7 +106,7 @@ if [[ -n "${GHCR_USERNAME:-}" && -n "${GHCR_TOKEN:-}" ]]; then
}

# Create secret and patch service accounts in all namespaces
for ns in infra databases games api; do
for ns in infra databases games api agones; do
log_info "Creating ghcr-pull-secret in namespace: ${ns}"
kubectl create secret docker-registry ghcr-pull-secret \
--docker-server=ghcr.io \
Expand Down
2 changes: 1 addition & 1 deletion helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ releases:

# Agones game server hosting platform
- name: agones
namespace: games
namespace: agones
chart: agones/agones
# Use latest stable version (no version pinning for Agones)
values:
Expand Down
48 changes: 48 additions & 0 deletions manifests/serviceaccount-velocity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: velocity
namespace: games
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: list-gameservers
namespace: games
rules:
- apiGroups:
- agones.dev
resources:
- gameservers
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: velocity-list-gameservers
namespace: games
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: list-gameservers
subjects:
- kind: ServiceAccount
name: velocity
namespace: games
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: velocity-agones-sdk
namespace: games
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: agones-sdk
subjects:
- kind: ServiceAccount
name: velocity
namespace: games
21 changes: 21 additions & 0 deletions scripts/create-velocity-secret.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -euo pipefail

here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${here}/common.sh"

namespace="games"
secret_name="velocity-forwarding-secret"

log_info "Creating ${secret_name} in namespace: ${namespace}"

secret_value="$(head -c 32 /dev/urandom | base64 | tr -d '\n')"

kubectl create secret generic "${secret_name}" \
-n "${namespace}" \
--from-literal="secret=${secret_value}" \
--dry-run=client \
-o yaml | kubectl apply -f -

log_success "Secret ${secret_name} updated"
79 changes: 12 additions & 67 deletions values/agones.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,76 +12,21 @@ agones:

# Allocator service configuration
allocator:
service:
http:
port: 10443
targetPort: 8443
grpc:
port: 10444
targetPort: 8444
# Disable allocator for local development
install: false

# Controller configuration
controller:
# Resource limits for local development
resources:
requests:
cpu: 100m # 0.1 CPU cores
memory: 256Mi # 256 MB RAM
limits:
cpu: 500m # 0.5 CPU cores
memory: 512Mi # 512 MB RAM

# Health checks - optimized for local development
livenessProbe:
enabled: true
initialDelaySeconds: 15
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 3
successThreshold: 1

readinessProbe:
enabled: true
initialDelaySeconds: 3
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 3
successThreshold: 1

# Disable metrics and monitoring for local development
metrics:
serviceMonitor:
enabled: false
# Disable Prometheus metrics
enabled: false

# Disable allocation service for local development
allocation:
enabled: false

# Disable autoscaler for local development
autoscaler:
enabled: false

# Disable fleet allocation for local development
fleetAllocation:
enabled: false

# Disable webhook for local development
webhook:
enabled: false
replicas: 1 # Single replica for local development

# Disable allocation service for local development
allocationService:
enabled: false
# Extensions configuration
extensions:
replicas: 1 # Single replica for local development

# Network policy (disabled for local development)
networkPolicy:
enabled: false
# Service Accounts configuration
serviceAccounts:
sdk:
name: agones-sdk

# Service configuration
service:
type: ClusterIP
ports:
http: 80
https: 443
gameservers:
namespaces: [ games ]