A fully working Kubernetes deployment of Graylog Open Source.
This setup deploys a minimal Graylog stack with:
- Graylog Core
- Graylog DataNode
- Secrets Management
- Persistent Volumes (PVCs) via
hostpath-provisioner - NodePort Exposure
Please review the allocated resources in the PVCs and the mongodb StatefulSet and ensure it matches your requirements.
This deployment is made for a small lab environment, it is recommened to increase the replicas and the allocated storage in the PVCs.
- Kubernetes cluster (e.g. Minikube or real cluster)
kubectlCLI configuredhostpath-provisionerinstalled from ArtifactHub
-
Create a namespace named
graylog:kubectl create ns graylog
-
Create the
graylog-password-secretused for internal communication:kubectl create secret generic -n graylog graylog-password-secret \ --from-literal=GRAYLOG_PASSWORD_SECRET=$(< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-96}; echo) -
Generate a SHA256 hash of your desired root password:
echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1
-
Create the
graylog-root-password-sha256secret using the hash:kubectl create secret generic -n graylog graylog-root-password-sha256 \ --from-literal=GRAYLOG_PASSWORD_SHA256=[YOUR_PASSWORD_HASH]
-
Clone this repository and apply the manifest files:
git clone https://github.com/shafnir/Graylog-Kubernetes.git cd Graylog-Kubernetes kubectl apply -f .
-
Verify pods are running:
kubectl get pods -n graylog
Example output:
NAME READY STATUS RESTARTS AGE datanode-5dcff9cffb-qf26r 1/1 Running 0 57m graylog-74558bdf5b-zcc8h 1/1 Running 0 61m mongodb-0 1/1 Running 0 61m
-
Retrieve the initial admin password from Graylog logs:
kubectl logs -n graylog graylog-74558bdf5b-zcc8h
You should see something like:
Initial configuration is accessible at 0.0.0.0:9000, with username 'admin' and password 'bhQRFNUvIe'. Try clicking on http://admin:bhQRFNUvIe@0.0.0.0:9000
-
Access the Graylog UI:
http://[your-node-ip]:30900 -
After completing the initial setup wizard, log in with username
adminand the password you set in Step 3.