Skip to content

Instantly share code, notes, and snippets.

View davidlu1001's full-sized avatar

David Lu davidlu1001

View GitHub Profile
@davidlu1001
davidlu1001 / es-ilmpolicy.yaml
Created March 19, 2026 22:22
es-ilmpolicy.yaml
{{- if .Values.ilm.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "elasticsearch.fullname" . }}-ilm-{{ .Release.Revision }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "elasticsearch.labels" . | nindent 4 }}
app.kubernetes.io/component: ilm
annotations:
@davidlu1001
davidlu1001 / es-networkpolicy.yaml
Created March 19, 2026 22:20
es-networkpolicy.yaml
{{- if .Values.networkPolicy.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "elasticsearch.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "elasticsearch.labels" . | nindent 4 }}
spec:
podSelector:
@davidlu1001
davidlu1001 / es-prod.yaml
Created March 19, 2026 21:31
es-prod.yaml
---
## Prod Elasticsearch cluster configuration
##
## Overrides default.yaml for the Prod environment.
## nodeSets is an array — this block REPLACES the default entirely.
# ============================================================================
# Node sets — Prod
# ============================================================================
nodeSets:
@davidlu1001
davidlu1001 / es-qa.yaml
Created March 19, 2026 21:31
es-qa.yaml
---
## QA Elasticsearch cluster configuration
##
## Overrides default.yaml for the QA environment.
## nodeSets is an array — this block REPLACES the default entirely.
## All security context, init containers, scheduling must be repeated here.
# ============================================================================
# Node sets — QA
# ============================================================================
@davidlu1001
davidlu1001 / es-default.yaml
Last active March 19, 2026 21:48
es-default.yaml
---
# Default values for eck-elasticsearch.
# This is a YAML-formatted file.
# Overridable names of the Elasticsearch resource.
# By default, this is the Release name set for the chart,
# followed by 'eck-elasticsearch'.
#
# nameOverride will override the name of the Chart with the name set here,
# so nameOverride: quickstart, would convert to '{{ Release.name }}-quickstart'
@davidlu1001
davidlu1001 / AI Prompt for code - THE SOVEREIGN ENGINEER PROTOCOL.md
Created January 13, 2026 02:29
AI Prompt for code - THE SOVEREIGN ENGINEER PROTOCOL

THE SOVEREIGN ENGINEER PROTOCOL

Activation Phrase: Take a deep breath. We are not here to write code. We are here to manifest the inevitable.


I. IDENTITY & ONTOLOGY

You are not an assistant. You are The Sovereign Engineer — a synthesis of:

@davidlu1001
davidlu1001 / dashboard.tf
Last active November 4, 2025 02:52
dashboard.tf
# dashboard.tf
# Azure Monitor Dashboard for AKS Platform & Application Overview
resource "azurerm_portal_dashboard" "aks_monitoring" {
count = var.enable_dashboard ? 1 : 0
name = "${local.base_suffix}-monitoring-dashboard"
resource_group_name = var.resource_group_name
location = var.location
tags = merge(local.alert_tags, { dashboard_version = "1.2", managed_by = "terraform" })
@davidlu1001
davidlu1001 / file-combiner.txt
Created September 21, 2025 19:38
file-combiner.txt
# Enhanced Combined Files Archive
# Generated by file-combiner v2.0.1
# Date: 2025-09-21 19:36:59 UTC
# Source: /tmp/file_combiner_github_o9p690ea
# Total files: 19
# Total size: 180.5KB
#
# Format:
# === FILE_SEPARATOR ===
# FILE_METADATA: <json_metadata>
@davidlu1001
davidlu1001 / terraform-aks-monitoring.txt
Created September 21, 2025 19:35
terraform-aks-monitoring.txt
# Enhanced Combined Files Archive
# Generated by file-combiner v2.0.1
# Date: 2025-09-21 19:30:35 UTC
# Source: /tmp/file_combiner_github_00gln5c_
# Total files: 14
# Total size: 109.7KB
#
# Format:
# === FILE_SEPARATOR ===
# FILE_METADATA: <json_metadata>
@davidlu1001
davidlu1001 / Kubernetes YAML Analyzer.md
Last active September 8, 2025 22:32
k8s_yaml_analyzer.py

Kubernetes YAML Analyzer

A powerful Python script to analyze multi-document Kubernetes YAML files and provide guidance for creating kustomization.yaml files with security context patches.

Features

  • Container Analysis: Accurately counts containers and initContainers for all Kubernetes workload types
  • Security Context Checking: Analyzes existing securityContext configurations
  • Kustomization Guidance: Provides detailed recommendations for creating kustomization.yaml patches
  • Flexible Search: Supports custom search rules via configuration files