Skip to content

Instantly share code, notes, and snippets.

@xiangshen-dk
xiangshen-dk / gke-fluentbit-workload-identity.sh
Created September 29, 2021 17:39
GKE fluentbit with workload identity
region=us-east1
zone=${region}-b
project_id=[YOUR_PROJECT_ID]
gcloud config set compute/zone ${zone}
gcloud config set project ${project_id}
gcloud container clusters create custom-fluentbit \
--zone $zone \
--logging=SYSTEM \
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluent-bit
namespace: logging
labels:
k8s-app: fluent-bit-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluent-bit
namespace: logging
labels:
k8s-app: fluent-bit-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: logging
labels:
k8s-app: fluent-bit
data:
# Configuration files: server, input, filters and output
# ======================================================
@xiangshen-dk
xiangshen-dk / fluent-bit-k8s-stackdriver-file.yaml
Last active October 1, 2020 13:59
Fluent Bit config for logs with large payloads.
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: logging
labels:
k8s-app: fluent-bit
data:
# Configuration files: server, input, filters and output
# ======================================================
@xiangshen-dk
xiangshen-dk / install.sh
Created July 16, 2020 04:39
Install the components for GCP cloud monitoring metrics export
#!/bin/bash
# Get curent project id
export PROJECT_ID=$(gcloud config get-value project)
echo "Current project id: $PROJECT_ID"
# Suppress Python 2 warning in Cloud Shell
mkdir -p ~/.cloudshell
touch ~/.cloudshell/no-python-warning