Skip to content

wedge22/k8s-mc-splunk-otel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft Bedrock Server Deployment on Google Cloud with Splunk OpenTelemetry

GCP Kubernetes Helm License

Table of Contents

Introduction

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.

Prerequisites

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).

Project Overview

This project involves the following key components:

  1. GKE Autopilot Cluster: Utilizes GKE Autopilot for managing the Kubernetes infrastructure.
  2. Minecraft Bedrock Server: Deployed as a Kubernetes application using a YAML configuration.
  3. Splunk OpenTelemetry Collector: Deployed via Helm to collect logs from Kubernetes pods and send them to Splunk Enterprise using HEC.

Setup Guide

Follow the steps below to set up the entire environment.

1. Create a New GCP Project

  1. Navigate to the GCP Console:

    Visit the GCP Console.

  2. 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".
  3. Set the Project in gcloud:

    gcloud config set project YOUR_PROJECT_ID

2. Enable GCP Services

Enable the necessary GCP services using the Cloud SDK CLI.

  1. Initialize gcloud (if not already done):

    gcloud init
  2. Enable Required Services:

    gcloud services enable container.googleapis.com
    gcloud services enable compute.googleapis.com

3. Set Up GKE Autopilot Cluster

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

4. Deploy Minecraft Bedrock Server

Deploy the Minecraft Bedrock Server using the provided YAML configuration.

  1. Clone the Repository:

    git clone https://github.com/wedge22/k8s-mc-splunk-otel.git
    cd k8s-mc-splunk-otel
  2. Navigate to the Deployment Guide:

    Follow the detailed steps in the GCP Guide.

  3. Apply the YAML Configuration:

    kubectl apply -f minecraft-bedrock-server.yaml

    This will create the necessary pods and services for the Minecraft server.

5. Deploy Splunk OpenTelemetry Collector

Integrate Splunk Otel Collector to collect and forward logs.

  1. 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
  2. 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 and YOUR_SPLUNK_HEC_ENDPOINT with your actual Splunk HEC details.

  3. Install the Splunk Otel Collector:

    helm install my-splunk-otel-collector --values values.yaml splunk-otel-collector-chart/splunk-otel-collector
  4. Verify the Installation:

    kubectl get pods
  5. 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.

Usage

Once all components are deployed:

  1. 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.

  2. 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.

Troubleshooting

  • 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.

References

License

This project is licensed under the MIT License.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published