- Introduction
- Prerequisites
- Project Overview
- Setup Guide
- Usage
- Troubleshooting
- References
- License
- Contact
Welcome to the Minecraft Bedrock Server Deployment project! This repository is part of my journey towards obtaining the Certified Kubernetes Administrator (CKA) certification. The project demonstrates how to deploy a Minecraft Bedrock Server on Google Cloud Platform (GCP) using Google Kubernetes Engine (GKE) Autopilot. Additionally, it integrates Splunk OpenTelemetry (Otel) Collector to collect and send logs to Splunk Enterprise hosted in my homelab.
Before you begin, ensure you have the following:
- Google Cloud Platform (GCP) Account: Sign up if you don't have one.
- Google Cloud SDK: Installed and configured. Installation Guide
- Kubectl: Installed for interacting with Kubernetes clusters. Installation Guide
- Helm: Installed for managing Kubernetes applications. Installation Guide
- Basic Knowledge: Familiarity with Kubernetes and Helm is beneficial.
- Splunk Enterprise: Deployed in your homelab with an available HTTP Event Collector (HEC).
This project involves the following key components:
- GKE Autopilot Cluster: Utilizes GKE Autopilot for managing the Kubernetes infrastructure.
- Minecraft Bedrock Server: Deployed as a Kubernetes application using a YAML configuration.
- Splunk OpenTelemetry Collector: Deployed via Helm to collect logs from Kubernetes pods and send them to Splunk Enterprise using HEC.
Follow the steps below to set up the entire environment.
-
Navigate to the GCP Console:
Visit the GCP Console.
-
Create a New Project:
- Click on the project dropdown in the top navigation bar.
- Select "New Project".
- Enter your Project Name and Billing Account.
- Click "Create".
-
Set the Project in gcloud:
gcloud config set project YOUR_PROJECT_ID
Enable the necessary GCP services using the Cloud SDK CLI.
-
Initialize gcloud (if not already done):
gcloud init
-
Enable Required Services:
gcloud services enable container.googleapis.com gcloud services enable compute.googleapis.com
Create a Kubernetes cluster using GKE Autopilot.
gcloud container clusters create-auto minecraft-cluster \
--region us-central1 \
--project YOUR_PROJECT_ID
Verify the cluster is up and running:
gcloud container clusters list
Deploy the Minecraft Bedrock Server using the provided YAML configuration.
-
Clone the Repository:
git clone https://github.com/wedge22/k8s-mc-splunk-otel.git cd k8s-mc-splunk-otel
-
Navigate to the Deployment Guide:
Follow the detailed steps in the GCP Guide.
-
Apply the YAML Configuration:
kubectl apply -f minecraft-bedrock-server.yaml
This will create the necessary pods and services for the Minecraft server.
Integrate Splunk Otel Collector to collect and forward logs.
-
Add Helm Repository for Splunk Otel Collector:
helm repo add splunk-otel-collector-chart https://signalfx.github.io/splunk-otel-collector-chart helm repo update
-
Create
values.yaml
:Customize the Helm chart with your Splunk credentials.
nano values.yaml
Example
values.yaml
:splunk: accessToken: YOUR_SPLUNK_ACCESS_TOKEN endpoint: https://ingest.YOUR_SPLUNK_HEC_ENDPOINT:443
Replace
YOUR_SPLUNK_ACCESS_TOKEN
andYOUR_SPLUNK_HEC_ENDPOINT
with your actual Splunk HEC details. -
Install the Splunk Otel Collector:
helm install my-splunk-otel-collector --values values.yaml splunk-otel-collector-chart/splunk-otel-collector
-
Verify the Installation:
kubectl get pods
-
Access the Pod (if needed):
kubectl exec --stdin --tty my-splunk-otel-collector-pod -- /bin/sh
Replace
my-splunk-otel-collector-pod
with the actual pod name.
Once all components are deployed:
-
Access the Minecraft Server:
-
Retrieve the external IP of the Minecraft service:
kubectl get services
-
Use the external IP to connect via your Minecraft Bedrock client.
-
-
Monitor Logs in Splunk:
- Navigate to your Splunk Enterprise dashboard.
- Use the HEC endpoint to view and analyze the logs collected from the Kubernetes pods.
-
Check Pod Status:
kubectl get pods
-
View Pod Logs:
kubectl logs pod-name
-
Describe Pod for Detailed Information:
kubectl describe pod pod-name
-
Helm Release Status:
helm status my-splunk-otel-collector
-
Common Issues:
- Service Not Accessible: Ensure the Kubernetes service has an external IP and that firewall rules allow traffic on the necessary ports.
- Splunk Logs Not Appearing: Verify the
values.yaml
configurations and ensure that the Splunk HEC endpoint and access token are correct.
- GCP Guide: k8s-mc-splunk-otel/gcp-guide.md
- Minecraft Bedrock Server YAML: minecraft-bedrock-server.yaml
- Casey West's Guide: Casey West - Minecraft Bedrock Server Setup
This project is licensed under the MIT License.