[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73SP8MC24WQZ0HXBPNRPCN0":3,"skill-same:01M73SP8MC24WQZ0HXBPNRPCN0":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M73SP8MC24WQZ0HXBPNRPCN0","docker-k8s",null,"Master containerization and orchestration with security-first approach. Expert in Docker multi-stage builds, Kubernetes zero-trust deployments, security hardening, GitOps workflows, and production-ready patterns for cloud-native applications. Includes 2025 best practices from CNCF and major cloud providers.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fdocker-k8s\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: docker-k8s\ndescription: Master containerization and orchestration with security-first approach. Expert in Docker multi-stage builds, Kubernetes zero-trust deployments, security hardening, GitOps workflows, and production-ready patterns for cloud-native applications. Includes 2025 best practices from CNCF and major cloud providers.\nlicense: MIT\n---\n\n# Containerization & Kubernetes with Security Hardening\n\nThis skill provides comprehensive patterns for containerizing applications and deploying to Kubernetes in 2025, focusing on zero-trust security, multi-stage optimization, production hardening, and cloud-native best practices that work across different cloud providers.\n\n## When to Use This Skill\n\nUse this skill when you need to:\n- Create secure multi-stage Docker builds\n- Deploy applications to Kubernetes with security hardening\n- Implement zero-trust security patterns\n- Set up GitOps workflows with ArgoCD\u002FFlux\n- Optimize container images for production\n- Configure cluster security with Pod Security Standards\n- Implement secure networking with service meshes\n- Set up monitoring and observability\n- Deploy to multiple cloud providers (AWS, GCP, Azure, DO)\n\n## Secure Multi-Stage Docker Builds\n\n### 1. Security-First Multi-Stage Builds\n\n```dockerfile\n# Dockerfile with security hardening\n# Build stage\nFROM python:3.11-slim AS builder\n\n# Set build-time security arguments\nARG DEBIAN_FRONTEND=noninteractive\nARG DEBCONF_NONINTERACTIVE_SEEN=true\nARG BUILDPLATFORM\nARG TARGETPLATFORM\n\n# Install build dependencies with security updates\nRUN apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install -y --no-install-recommends \\\n        build-essential \\\n        libpq-dev \\\n        ca-certificates \\\n        curl \\\n        && \\\n    apt-get clean && \\\n    rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F* \u002Ftmp\u002F* \u002Fvar\u002Ftmp\u002F* && \\\n    truncate -s 0 \u002Fvar\u002Flog\u002Fapt\u002Fhistory.log\n\n# Create non-root user for build\nRUN groupadd -r builder && \\\n    useradd -r -g builder builder\n\n# Set working directory\nWORKDIR \u002Fapp\n\n# Copy dependency files\nCOPY requirements.txt requirements-dev.txt .\u002F\n\n# Install Python dependencies in virtual environment\nRUN python -m venv \u002Fopt\u002Fvenv && \\\n    \u002Fopt\u002Fvenv\u002Fbin\u002Fpip install --no-cache-dir -U pip && \\\n    \u002Fopt\u002Fvenv\u002Fbin\u002Fpip install --no-cache-dir -r requirements.txt\n\n# Production stage\nFROM python:3.11-slim AS production\n\n# Security labels\nLABEL maintainer=\"security-team@company.com\" \\\n      version=\"1.0.0\" \\\n      security.scan=\"enabled\" \\\n      org.opencontainers.image.vendor=\"Company\"\n\n# Install runtime dependencies with security updates\nRUN apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install -y --no-install-recommends \\\n        libpq5 \\\n        ca-certificates \\\n        curl \\\n        dumb-init \\\n        && \\\n    apt-get clean && \\\n    rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F* \u002Ftmp\u002F* \u002Fvar\u002Ftmp\u002F* && \\\n    truncate -s 0 \u002Fvar\u002Flog\u002Fapt\u002Fhistory.log\n\n# Copy virtual environment from builder\nCOPY --from=builder \u002Fopt\u002Fvenv \u002Fopt\u002Fvenv\n\n# Create non-root user for runtime\nRUN groupadd -r appuser && \\\n    useradd -r -g appuser -s \u002Fbin\u002Fsh appuser\n\n# Set working directory\nWORKDIR \u002Fapp\n\n# Copy application code\nCOPY --chown=appuser:appuser app\u002F .\u002Fapp\u002F\nCOPY --chown=appuser:appuser alembic\u002F .\u002Falembic\u002F\nCOPY --chown=appuser:appuser alembic.ini .\n\n# Set permissions\nRUN chmod -R 755 \u002Fapp && \\\n    chmod -x \u002Fapp\u002Falembic.ini\n\n# Switch to non-root user\nUSER appuser\n\n# Set PATH\nENV PATH=\"\u002Fopt\u002Fvenv\u002Fbin:$PATH\"\n\n# Health check\nHEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \\\n    CMD curl -f http:\u002F\u002Flocalhost:8000\u002Fhealth || exit 1\n\n# Security scan before running\nRUN python -c \"import urllib.request; urllib.request.urlopen('https:\u002F\u002Fsecurity-scan.example.com\u002Fscan')\"\n\n# Expose port\nEXPOSE 8000\n\n# Use dumb-init as PID 1\nENTRYPOINT [\"dumb-init\", \"--\"]\n\n# Run the application\nCMD [\"python\", \"-m\", \"uvicorn\", \"app.main:app\", \"--host\", \"0.0.0.0\", \"--port\", \"8000\", \"--workers=4\", \"--access-log=-\"]\n```\n\n### 2. Docker Security Best Practices\n\n```dockerfile\n# Dockerfile.security\n# Base security hardening\nFROM python:3.11-slim AS base\n\n# Kernel security settings\nRUN sysctl -w net.ipv4.ip_forward=1 && \\\n    sysctl -w net.ipv6.conf.all.forwarding=1 && \\\n    sysctl -w net.ipv4.conf.all.send_redirects=0 && \\\n    sysctl -w net.ipv4.conf.default_accept_source_route=0 && \\\n    sysctl -w kernel.dmesg_restrict=1\n\n# Remove setuid\u002Fsetgid binaries\nRUN find \u002F -type f -perm \u002F6000 -exec chmod a-s {} \\; || true && \\\n    find \u002F -type f -perm \u002F4000 -exec chmod a+r {} \\; || true\n\n# Security scanning\nRUN apt-get update && \\\n    apt-get install -y trivy && \\\n    trivy image --severity HIGH,CRITICAL python:3.11-slim\n\n# Production application with security\nFROM base AS production\n\n# Add security labels\nLABEL \\\n    security.stack.linux.docker.image-version=\"1\" \\\n    security.stack.linux.docker.kernel-version=\"6.x\" \\\n    security.stack.linux.docker.os-version=\"Debian 12\" \\\n    security.stack.cis.docker.version=\"1.6.0\"\n\n# Implement runtime security\nRUN apt-get update && \\\n    apt-get install -y \\\n        apparmor-profiles \\\n        fail2ban \\\n        rkhunter \\\n        chkrootkit \\\n    && \\\n    apt-get clean\n\n# Configure fail2ban\nCOPY fail2ban.conf \u002Fetc\u002Ffail2ban\u002Fjail.local\n\n# Configure AppArmor\nCOPY apparmor-profiles \u002Fetc\u002Fapparmor.d\u002F\n\n# Security runtime checks\nRUN python -c \"\nimport subprocess\nimport sys\n\n# Check for vulnerable packages\nresult = subprocess.run(['apt', 'list', '--upgradable'],\n                        capture_output=True, text=True)\nif result.stdout.strip():\n    print('WARNING: Packages need updates:', result.stdout.strip())\n    sys.exit(1)\n\"\n```\n\n### 3. Zero-Trust Kubernetes Deployment\n\n```yaml\n# manifests\u002Fnamespace.yaml\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: production\n  labels:\n    name: production\n    security-tier: \"high\"\n    environment: \"production\"\n  annotations:\n    pod-security.kubernetes.io\u002Fenforce: \"restricted\"\n    pod-security.kubernetes.io\u002Faudit: \"restricted\"\n    pod-security.kubernetes.io\u002Fwarn: \"restricted\"\n\n---\n# manifests\u002Frbac.yaml\napiVersion: rbac.authorization.k8s.io\u002Fv1\nkind: ClusterRole\nmetadata:\n  name: production-apps\nrules:\n- apiGroups: [\"\"]\n  resources: [\"pods\", \"services\", \"configmaps\", \"secrets\"]\n  verbs: [\"get\", \"list\", \"watch\"]\n- apiGroups: [\"apps\"]\n  resources: [\"deployments\", \"replicasets\", \"daemonsets\"]\n  verbs: [\"get\", \"list\", \"watch\"]\n- apiGroups: [\"networking.k8s.io\"]\n  resources: [\"networkpolicies\"]\n  verbs: [\"get\", \"list\", \"create\", \"update\", \"patch\"]\n\n---\napiVersion: rbac.authorization.kubernetes.io\u002Fv1\nkind: ClusterRoleBinding\nmetadata:\n  name: production-apps-binding\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: production-apps\nsubjects:\n- kind: ServiceAccount\n  name: default\n  namespace: production\n\n---\n# manifests\u002Fnetwork-policy.yaml\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: default-deny-all\n  namespace: production\nspec:\n  podSelector: {}\n  policyTypes:\n  - Ingress\n  - Egress\n  # Deny all ingress and egress by default\n\n---\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: allow-dns\n  namespace: production\nspec:\n  podSelector: {}\n  policyTypes:\n  - Egress\n  egress:\n  - to: []\n    ports:\n    - protocol: UDP\n      port: 53\n    - protocol: TCP\n      port: 53\n  - to: []\n    ports:\n    - protocol: TCP\n      port: 443\n    - protocol: TCP\n      port: 53\n\n---\n# manifests\u002Fdeployment.yaml\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: secure-app\n  namespace: production\n  labels:\n    app: secure-app\n    tier: application\n    version: v1\nspec:\n  replicas: 3\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxSurge: 1\n      maxUnavailable: 0\n  selector:\n    matchLabels:\n      app: secure-app\n  template:\n    metadata:\n      labels:\n        app: secure-app\n      tier: application\n      version: v1\n      security.stack.company.com\u002Fcontainer-security-level: \"high\"\n      security.stack.company.com\u002Fnetwork-segment: \"application\"\n    annotations:\n      container.security.kubernetes.io\u002Fscc: \"restricted\"\n      seccomp.security.kubernetes.io\u002Fprofile: \"runtime\u002Fdefault\"\n      kubernetes.io\u002Fpsp: \"restricted\"\n    spec:\n      securityContext:\n        runAsNonRoot: true\n        runAsUser: 1000\n        runAsGroup: 3000\n        fsGroup: 2000\n        seccompProfile:\n          type: RuntimeDefault\n        readOnlyRootFilesystem: false\n        capabilities:\n          drop:\n          - ALL\n          add:\n            - NET_BIND_SERVICE\n      containers:\n      - name: app\n        image: your-registry\u002Fsecure-app:v1.0.0\n        imagePullPolicy: Always\n        ports:\n        - containerPort: 8000\n          name: http\n          protocol: TCP\n        env:\n        - name: DATABASE_URL\n          valueFrom:\n            secretKeyRef:\n              name: app-secrets\n              key: database-url\n        resources:\n          limits:\n            cpu: \"500m\"\n            memory: \"512Mi\"\n          requests:\n            cpu: \"100m\"\n            memory: \"128Mi\"\n        livenessProbe:\n          httpGet:\n            path: \u002Fhealth\n            port: 8000\n          initialDelaySeconds: 30\n          periodSeconds: 10\n          timeoutSeconds: 5\n          failureThreshold: 3\n          successThreshold: 1\n        readinessProbe:\n          httpGet:\n            path: \u002Fready\n            port: 8000\n          initialDelaySeconds: 5\n          periodSeconds: 5\n          timeoutSeconds: 3\n          failureThreshold: 3\n          successThreshold: 1\n        startupProbe:\n          httpGet:\n            path: \u002Fhealth\n            port: 8000\n          failureThreshold: 30\n          periodSeconds: 10\n        securityContext:\n          allowPrivilegeEscalation: false\n          readOnlyRootFilesystem: false\n          capabilities:\n            drop:\n            - ALL\n        volumeMounts:\n        - name: tmp\n          mountPath: \u002Ftmp\n        - name: cache\n          mountPath: \u002Fcache\n      volumes:\n      - name: tmp\n        emptyDir: {}\n      - name: cache\n        emptyDir: {}\n      imagePullSecrets:\n      - name: registry-secret\n      serviceAccountName: restricted-sa\n      automountServiceAccountToken: false\n\n---\n# manifests\u002Fservice-account.yaml\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: restricted-sa\n  namespace: production\n  annotations:\n    iam.gke.io\u002Fgcp-service-account: \"production-sa@your-project.iam.gserviceaccount.com\"\n    eks.amazonaws.com\u002Frole-arn: \"arn:aws:iam::123456789012:role\u002Fproduction-role\"\n\n---\n# manifests\u002Fpod-security-policy.yaml\napiVersion: policy\u002Fv1beta1\nkind: PodSecurityPolicy\nmetadata:\n  name: restricted-psp\n  namespace: production\nspec:\n  privileged: false\n  allowPrivilegeEscalation: false\n  requiredDropCapabilities:\n    - ALL\n  volumes:\n    - 'configMap'\n    - 'emptyDir'\n    - 'projected'\n    - 'secret'\n    'downwardAPI'\n    'persistentVolumeClaim'\n  runAsUser:\n    rule: 'MustRunAsNonRoot'\n  seLinux:\n    rule: 'RunAsAny'\n  fsGroup:\n    rule: 'RunAsAny'\n```\n\n### 4. Service Mesh with Istio\n\n```yaml\n# istio\u002Fistio-config.yaml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: istio-config\n  namespace: istio-system\ndata:\n  meshConfig: |\n    accessLogFile: \u002Fdev\u002Fstdout\n    defaultConfig:\n      concurrency: 3\n      circuitBreakers:\n        consecutive5xxErrors: 5\n        timeout: 30s\n        maxConnections: 1000\n        maxRequestsPerConnection: 500\n      connectionPoolSettings:\n        tcp:\n          maxConnections: 100\n          connectTimeout: 10s\n        http:\n          http2MaxRequests: 100\n          maxRequestsPerConnection: 10\n          maxRetries: 3\n      outlierDetection:\n        consecutiveGatewayErrors: 5\n        interval: 30s\n        baseEjectionTime: 30s\n        maxEjectionPercent: 100\n      proxyStatsMatcher: \"-x\"\n      telemetry:\n        v2:\n          prometheus:\n            enabled: true\n            customTags:\n              app: \"secure-app\"\n              version: \"v1\"\n\n---\n# istio\u002Fdestination-rule.yaml\napiVersion: networking.istio.io\u002Fv1beta1\nkind: DestinationRule\nmetadata:\n  name: secure-app\n  namespace: production\nspec:\n  host: secure-app\n  trafficPolicy:\n    tls:\n      mode: ISTIO_MUTUAL\n      clientCertificate:\n        - \u002Fetc\u002Fistio\u002Fdestination-client-certs\n    connectionPool:\n      tcp:\n        maxConnections: 100\n        connectTimeout: 30s\n        keepAlive:\n          time: 7200s\n          requests: 10000\n      http:\n        http2MaxRequests: 1000\n        maxRequestsPerConnection: 100\n        maxRetries: 3\n        idleTimeout: 120s\n        h2UpgradePolicy: RFC\n        keepAlive:\n          time: 7200s\n          requests: 100\n    loadBalancer:\n      simple: LEAST_CONN\n    circuitBreaker:\n      consecutiveErrors: 7\n      interval: 30s\n      baseEjectionTime: 30s\n      maxEjectionPercent: 100\n    outlierDetection:\n      consecutive5xxErrors: 5\n      interval: 30s\n      baseEjectionTime: 30s\n      maxEjectionPercent: 10\n    retryOn:\n      - connect-failure\n      - refused-stream\n      - canceled\n      - timeout\n      - retriable-status\n    retryOff:\n      - overloaded\n      - deadline-exceeded\n      - unknown\n    timeout: 300s\n    tls:\n      mode: ISTIO_MUTUAL\n  subsets:\n  - name: v1\n    labels:\n      version: v1\n    trafficPolicy:\n      loadBalancer:\n        leastRequestConn: 100\n      connectionPool:\n        tcp:\n          maxConnections: 10\n          connectTimeout: 10s\n          keepAlive:\n            time: 300s\n        http:\n          http1MaxPendingRequests: 10\n          maxRequestsPerConnection: 2\n          maxRetries: 2\n          idleTimeout: 60s\n      outlierDetection:\n        consecutiveErrors: 3\n        interval: 15s\n        baseEjectionTime: 15s\n        maxEjectionPercent: 10\n      timeout: 60s\n\n---\n# istio\u002Fvirtual-service.yaml\napiVersion: networking.istio.io\u002Fv1beta1\nkind: VirtualService\nmetadata:\n  name: secure-app\n  namespace: production\nspec:\n  hosts:\n  - secure-app.production.company.com\n  gateways:\n  - istio-system\u002Fingressgateway\n  http:\n  - match:\n    - uri:\n        prefix: \u002F\n    retries:\n      attempts: 3\n      perTryTimeout: 2s\n      retryOn: [5xx, connect-failure, refused-stream]\n    fault:\n      delay:\n        percentage:\n          value: 0\n        fixedDelay: 0s\n    timeout: 300s\n    route:\n    - destination:\n        host: secure-app\n        subset: v1\n    mirror:\n      host: secure-app\n      subset: v1\n      mirrorPercentage:\n        value: 5\n    http:\n    - match:\n      - headers:\n          canary: \"true\"\n      route:\n      - destination:\n          host: secure-app\n          subset: canary\n      weight: 10\n    http:\n    - route:\n      - destination:\n          host: secure-app\n          subset: v1\n      weight: 90\n```\n\n### 5. ArgoCD GitOps Configuration\n\n```yaml\n# argocd\u002Fapplication.yaml\napiVersion: argoproj.io\u002Fv1alpha1\nkind: Application\nmetadata:\n  name: secure-app\n  namespace: argocd\n  finalizers:\n  - resources-finalizer.argocd.argoproj.io\nspec:\n  project: default\n  source:\n    repoURL: https:\u002F\u002Fgithub.com\u002Fcompany\u002Fsecure-app-k8s\n    targetRevision: HEAD\n    path: kubernetes\u002Fproduction\n  destination:\n      server: https:\u002F\u002Fkubernetes.default.svc\n      namespace: production\n  syncPolicy:\n    automated:\n      prune: true\n      selfHeal: true\n      allowEmpty: false\n    syncOptions:\n    - CreateNamespace=true\n    - PruneLast=false\n    - PrunePropagationPolicy=foreground\n    retry:\n      limit: 5\n    backoff:\n      duration: 5s\n      factor: 2\n      maxDuration: 3m\n  ignoreDifferences:\n    - JSONPath: '.spec.template.spec.replicas'\n  revisionHistoryLimit: 10\n  plugins:\n  - name: argocd-image-updater\n    args:\n      - image-updater\n      - allow-tags\n      - kwok='image-tag: \"*\"'\n  - name: argocd-notifications\n    args:\n      - notifications\n      - service: slack\n      - slack-token: $SLACK_TOKEN\n  - name: argocd-cm\n    args:\n      - cm\n      - configMapName: argocd-cm\n      - configMapKey: config.yaml\n```\n\n### 6. Monitoring and Observability\n\n```yaml\n# monitoring\u002Fprometheus.yaml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: prometheus-config\n  namespace: monitoring\ndata:\n  prometheus.yml: |\n    global:\n      scrape_interval: 15s\n      evaluation_interval: 15s\n\n    rule_files:\n      - \"\u002Fetc\u002Fprometheus\u002Frules\u002F*.yml\"\n\n    scrape_configs:\n      - job_name: 'kubernetes-pods'\n        kubernetes_sd_configs:\n          - role: pod\n        relabel_configs:\n          - source_labels: [__meta_kubernetes_pod_label_name]\n            target_label: pod\n          - source_labels: [__meta_kubernetes_namespace]\n            target_label: namespace\n          - source_labels: [__meta_kubernetes_pod_label_app]\n            target_label: app\n          - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]\n            action: keep\n            regex: true\n            source_label: __meta_kubernetes_pod_annotation_prometheus_io_scrape\n            target_label: __meta_kubernetes_pod_annotation_prometheus_io_scrape\n        metric_relabel_configs:\n          - source_labels: [__name__]\n            regex: 'instance_.*'\n            target_label: instance\n          - action: labelmap\n            regex: 'pod_.*'\n            target_label: pod\n          - source_labels: [__name__]\n            regex: 'namespace_.*'\n            target_label: namespace\n          - source_labels: [__name__]\n            regex: 'workload_.*'\n            target_label: workload\n      - job_name: 'kubernetes-services'\n        kubernetes_sd_configs:\n          - role: service\n        relabel_configs:\n          - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]\n            action: keep\n            regex: true\n            source_label: __meta_kubernetes_service_annotation_prometheus_io_scrape\n            target_label: __meta_kubernetes_service_annotation_prometheus_io_scrape\n          - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]\n            action: keep\n            regex: true\n            source_label: __meta_kubernetes_service_annotation_prometheus_io_scheme\n            target_label: __meta_kubernetes_service_annotation_prometheus_io_scheme\n          - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]\n            action: keep\n            regex: true\n            source_label: __meta_kubernetes_service_annotation_prometheus_io_path\n            target_label: __meta_kubernetes_service_annotation_prometheus_io_path\n          - source_labels: [__meta_kubernetes_service_name]\n            target_label: kubernetes_name\n          - source_labels: [__meta_kubernetes_namespace]\n            target_label: kubernetes_namespace\n          - source_labels: [__meta_kubernetes_service_label]\n            target_label: kubernetes_name\n\n# Security rules\n---\napiVersion: v1\nkind: Secret\nmetadata:\n  name: prometheus-rules\n  namespace: monitoring\ntype: Opaque\nstringData:\n  security-alerts.yml: |\n    groups:\n    - name: security.rules\n      rules:\n        - alert: HighErrorRate\n          expr: rate(http_requests_total{job=\"kubernetes-pods\",status=\"5xx\"}[5m]) > 0.1\n          for: 5m\n          labels:\n            severity: \"critical\"\n          annotations:\n            summary: \"High error rate detected\"\n            description: \"Error rate is above 10% for 5 minutes\"\n            runbook_url: \"https:\u002F\u002Frunbooks.company.com\u002Fhigh-error-rate\"\n        - alert: UnauthorizedAccess\n          expr: rate(http_requests_total{status=\"401\"}[5m]) > 5\n          for: 5m\n          labels:\n            severity: \"warning\"\n          annotations:\n            summary: \"Unauthorized access attempts\"\n            description: \"More than 5 unauthorized requests per minute\"\n            runbook_url: \"https:\u002F\u002Frunbooks.company.com\u002Funauthorized-access\"\n        - alert: ContainerRestarts\n          expr: rate(kube_pod_container_status_restarts_total[15m]) > 3\n          for: 15m\n          labels:\n            severity: \"warning\"\n          annotations:\n            summary: \"Container restarts detected\"\n            description: \"Container has restarted more than 3 times in 15 minutes\"\n            runbook_url: \"https:\u002F\u002Frunbooks.company.com\u002Fcontainer-restarts\"\n```\n\n### 7. Production Deployment Checklist\n\n```yaml\n# deployment\u002Fproduction-checklist.yaml\nsecurity:\n  container_security:\n    minimal_base_image: true\n    minimal_packages: true\n    security_scanning: true\n    vulnerability_scanning: true\n    sbom_generation: true\n\n  runtime_security:\n    non_root_user: true\n    readonly_filesystem: false\n    capabilities_dropped_all: true\n    seccomp_enabled: true\n    apparmor_enabled: true\n    selinux_enabled: true\n\n  network_security:\n    network_policies: true\n    service_mesh: true\n    mtls_enabled: true\n    tls_version: \"1.3\"\n    certificate_rotation: true\n\n  secrets_management:\n    encrypted_secrets: true\n    key_rotation: true\n    secret_versioning: true\n    access_control: true\n\n  rbac:\n    principle_of_least_privilege: true\n    service_accounts_limited: true\n    token_min_ttl: true\n    token_autorenewal: false\n\n  compliance:\n    cis_benchmark: true\n    pod_security_standards: true\n    nist_controls: true\n    pci_dss: true\n    hipaa: true\n\nobservability:\n  monitoring:\n    metrics_collection: true\n    custom_metrics: true\n    alerting_enabled: true\n    dashboard_creation: true\n\n  logging:\n    structured_logging: true\n    log_aggregation: true\n    log_retention: true\n    sensitive_data_redaction: true\n\n  tracing:\n    distributed_tracing: true\n    span_sampling: true\n    performance_tracking: true\n    error_tracking: true\n\n  auditing:\n    api_audit_logging: true\n    system_event_logging: true\n    security_event_logging: true\n    compliance_reporting: true\n\nperformance:\n  resource_management:\n    resource_limits: true\n    resource_quotas: true\n    hpa_enabled: true\n    cluster_autoscaling: true\n\n  optimization:\n    image_optimization: true\n    caching_enabled: true\n    compression: true\n    connection_pooling: true\n    batch_processing: true\n\ndisaster_recovery:\n  backup_strategy:\n    automated_backups: true\n    backup_encryption: true\n    cross_region_backup: true\n    restore_testing: true\n\n  high_availability:\n    multi_zone_deployment: true\n    health_checks: true\n    auto_healing: true\n    graceful_shutdown: true\n    rolling_updates: true\n\n  testing:\n  security_testing:\n    penetration_testing: true\n    vulnerability_scanning: true\n    compliance_testing: true\n    chaos_testing: true\n\n  performance_testing:\n    load_testing: true\n    stress_testing: true\n    scalability_testing: true\n    reliability_testing: true\n```\n\nThis comprehensive Docker\u002FKubernetes skill provides security-first containerization and deployment patterns for 2025, including zero-trust architectures, service mesh integration, GitOps workflows, and production-ready security hardening that works across different cloud providers and meets modern compliance standards.","# Containerization & Kubernetes with Security Hardening\n\nThis skill provides comprehensive patterns for containerizing applications and deploying to Kubernetes in 2025, focusing on zero-trust security, multi-stage optimization, production hardening, and cloud-native best practices that work across different cloud providers.\n\n## When to Use This Skill\n\nUse this skill when you need to:\n- Create secure multi-stage Docker builds\n- Deploy applications to Kubernetes with security hardening\n- Implement zero-trust security patterns\n- Set up GitOps workflows with ArgoCD\u002FFlux\n- Optimize container images for production\n- Configure cluster security with Pod Security Standards\n- Implement secure networking with service meshes\n- Set up monitoring and observability\n- Deploy to multiple cloud providers (AWS, GCP, Azure, DO)\n\n## Secure Multi-Stage Docker Builds\n\n### 1. Security-First Multi-Stage Builds\n\n```dockerfile\n# Dockerfile with security hardening\n# Build stage\nFROM python:3.11-slim AS builder\n\n# Set build-time security arguments\nARG DEBIAN_FRONTEND=noninteractive\nARG DEBCONF_NONINTERACTIVE_SEEN=true\nARG BUILDPLATFORM\nARG TARGETPLATFORM\n\n# Install build dependencies with security updates\nRUN apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install -y --no-install-recommends \\\n        build-essential \\\n        libpq-dev \\\n        ca-certificates \\\n        curl \\\n        && \\\n    apt-get clean && \\\n    rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F* \u002Ftmp\u002F* \u002Fvar\u002Ftmp\u002F* && \\\n    truncate -s 0 \u002Fvar\u002Flog\u002Fapt\u002Fhistory.log\n\n# Create non-root user for build\nRUN groupadd -r builder && \\\n    useradd -r -g builder builder\n\n# Set working directory\nWORKDIR \u002Fapp\n\n# Copy dependency files\nCOPY requirements.txt requirements-dev.txt .\u002F\n\n# Install Python dependencies in virtual environment\nRUN python -m venv \u002Fopt\u002Fvenv && \\\n    \u002Fopt\u002Fvenv\u002Fbin\u002Fpip install --no-cache-dir -U pip && \\\n    \u002Fopt\u002Fvenv\u002Fbin\u002Fpip install --no-cache-dir -r requirements.txt\n\n# Production stage\nFROM python:3.11-slim AS production\n\n# Security labels\nLABEL maintainer=\"security-team@company.com\" \\\n      version=\"1.0.0\" \\\n      security.scan=\"enabled\" \\\n      org.opencontainers.image.vendor=\"Company\"\n\n# Install runtime dependencies with security updates\nRUN apt-get update && \\\n    apt-get upgrade -y && \\\n    apt-get install -y --no-install-recommends \\\n        libpq5 \\\n        ca-certificates \\\n        curl \\\n        dumb-init \\\n        && \\\n    apt-get clean && \\\n    rm -rf \u002Fvar\u002Flib\u002Fapt\u002Flists\u002F* \u002Ftmp\u002F* \u002Fvar\u002Ftmp\u002F* && \\\n    truncate -s 0 \u002Fvar\u002Flog\u002Fapt\u002Fhistory.log\n\n# Copy virtual environment from builder\nCOPY --from=builder \u002Fopt\u002Fvenv \u002Fopt\u002Fvenv\n\n# Create non-root user for runtime\nRUN groupadd -r appuser && \\\n    useradd -r -g appuser -s \u002Fbin\u002Fsh appuser\n\n# Set working directory\nWORKDIR \u002Fapp\n\n# Copy application code\nCOPY --chown=appuser:appuser app\u002F .\u002Fapp\u002F\nCOPY --chown=appuser:appuser alembic\u002F .\u002Falembic\u002F\nCOPY --chown=appuser:appuser alembic.ini .\n\n# Set permissions\nRUN chmod -R 755 \u002Fapp && \\\n    chmod -x \u002Fapp\u002Falembic.ini\n\n# Switch to non-root user\nUSER appuser\n\n# Set PATH\nENV PATH=\"\u002Fopt\u002Fvenv\u002Fbin:$PATH\"\n\n# Health check\nHEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \\\n    CMD curl -f http:\u002F\u002Flocalhost:8000\u002Fhealth || exit 1\n\n# Security scan before running\nRUN python -c \"import urllib.request; urllib.request.urlopen('https:\u002F\u002Fsecurity-scan.example.com\u002Fscan')\"\n\n# Expose port\nEXPOSE 8000\n\n# Use dumb-init as PID 1\nENTRYPOINT [\"dumb-init\", \"--\"]\n\n# Run the application\nCMD [\"python\", \"-m\", \"uvicorn\", \"app.main:app\", \"--host\", \"0.0.0.0\", \"--port\", \"8000\", \"--workers=4\", \"--access-log=-\"]\n```\n\n### 2. Docker Security Best Practices\n\n```dockerfile\n# Dockerfile.security\n# Base security hardening\nFROM python:3.11-slim AS base\n\n# Kernel security settings\nRUN sysctl -w net.ipv4.ip_forward=1 && \\\n    sysctl -w net.ipv6.conf.all.forwarding=1 && \\\n    sysctl -w net.ipv4.conf.all.send_redirects=0 && \\\n    sysctl -w net.ipv4.conf.default_accept_source_route=0 && \\\n    sysctl -w kernel.dmesg_restrict=1\n\n# Remove setuid\u002Fsetgid binaries\nRUN find \u002F -type f -perm \u002F6000 -exec chmod a-s {} \\; || true && \\\n    find \u002F -type f -perm \u002F4000 -exec chmod a+r {} \\; || true\n\n# Security scanning\nRUN apt-get update && \\\n    apt-get install -y trivy && \\\n    trivy image --severity HIGH,CRITICAL python:3.11-slim\n\n# Production application with security\nFROM base AS production\n\n# Add security labels\nLABEL \\\n    security.stack.linux.docker.image-version=\"1\" \\\n    security.stack.linux.docker.kernel-version=\"6.x\" \\\n    security.stack.linux.docker.os-version=\"Debian 12\" \\\n    security.stack.cis.docker.version=\"1.6.0\"\n\n# Implement runtime security\nRUN apt-get update && \\\n    apt-get install -y \\\n        apparmor-profiles \\\n        fail2ban \\\n        rkhunter \\\n        chkrootkit \\\n    && \\\n    apt-get clean\n\n# Configure fail2ban\nCOPY fail2ban.conf \u002Fetc\u002Ffail2ban\u002Fjail.local\n\n# Configure AppArmor\nCOPY apparmor-profiles \u002Fetc\u002Fapparmor.d\u002F\n\n# Security runtime checks\nRUN python -c \"\nimport subprocess\nimport sys\n\n# Check for vulnerable packages\nresult = subprocess.run(['apt', 'list', '--upgradable'],\n                        capture_output=True, text=True)\nif result.stdout.strip():\n    print('WARNING: Packages need updates:', result.stdout.strip())\n    sys.exit(1)\n\"\n```\n\n### 3. Zero-Trust Kubernetes Deployment\n\n```yaml\n# manifests\u002Fnamespace.yaml\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: production\n  labels:\n    name: production\n    security-tier: \"high\"\n    environment: \"production\"\n  annotations:\n    pod-security.kubernetes.io\u002Fenforce: \"restricted\"\n    pod-security.kubernetes.io\u002Faudit: \"restricted\"\n    pod-security.kubernetes.io\u002Fwarn: \"restricted\"\n\n---\n# manifests\u002Frbac.yaml\napiVersion: rbac.authorization.k8s.io\u002Fv1\nkind: ClusterRole\nmetadata:\n  name: production-apps\nrules:\n- apiGroups: [\"\"]\n  resources: [\"pods\", \"services\", \"configmaps\", \"secrets\"]\n  verbs: [\"get\", \"list\", \"watch\"]\n- apiGroups: [\"apps\"]\n  resources: [\"deployments\", \"replicasets\", \"daemonsets\"]\n  verbs: [\"get\", \"list\", \"watch\"]\n- apiGroups: [\"networking.k8s.io\"]\n  resources: [\"networkpolicies\"]\n  verbs: [\"get\", \"list\", \"create\", \"update\", \"patch\"]\n\n---\napiVersion: rbac.authorization.kubernetes.io\u002Fv1\nkind: ClusterRoleBinding\nmetadata:\n  name: production-apps-binding\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: production-apps\nsubjects:\n- kind: ServiceAccount\n  name: default\n  namespace: production\n\n---\n# manifests\u002Fnetwork-policy.yaml\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: default-deny-all\n  namespace: production\nspec:\n  podSelector: {}\n  policyTypes:\n  - Ingress\n  - Egress\n  # Deny all ingress and egress by default\n\n---\napiVersion: networking.k8s.io\u002Fv1\nkind: NetworkPolicy\nmetadata:\n  name: allow-dns\n  namespace: production\nspec:\n  podSelector: {}\n  policyTypes:\n  - Egress\n  egress:\n  - to: []\n    ports:\n    - protocol: UDP\n      port: 53\n    - protocol: TCP\n      port: 53\n  - to: []\n    ports:\n    - protocol: TCP\n      port: 443\n    - protocol: TCP\n      port: 53\n\n---\n# manifests\u002Fdeployment.yaml\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: secure-app\n  namespace: production\n  labels:\n    app: secure-app\n    tier: application\n    version: v1\nspec:\n  replicas: 3\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxSurge: 1\n      maxUnavailable: 0\n  selector:\n    matchLabels:\n      app: secure-app\n  template:\n    metadata:\n      labels:\n        app: secure-app\n      tier: application\n      version: v1\n      security.stack.company.com\u002Fcontainer-security-level: \"high\"\n      security.stack.company.com\u002Fnetwork-segment: \"application\"\n    annotations:\n      container.security.kubernetes.io\u002Fscc: \"restricted\"\n      seccomp.security.kubernetes.io\u002Fprofile: \"runtime\u002Fdefault\"\n      kubernetes.io\u002Fpsp: \"restricted\"\n    spec:\n      securityContext:\n        runAsNonRoot: true\n        runAsUser: 1000\n        runAsGroup: 3000\n        fsGroup: 2000\n        seccompProfile:\n          type: RuntimeDefault\n        readOnlyRootFilesystem: false\n        capabilities:\n          drop:\n          - ALL\n          add:\n            - NET_BIND_SERVICE\n      containers:\n      - name: app\n        image: your-registry\u002Fsecure-app:v1.0.0\n        imagePullPolicy: Always\n        ports:\n        - containerPort: 8000\n          name: http\n          protocol: TCP\n        env:\n        - name: DATABASE_URL\n          valueFrom:\n            secretKeyRef:\n              name: app-secrets\n              key: database-url\n        resources:\n          limits:\n            cpu: \"500m\"\n            memory: \"512Mi\"\n          requests:\n            cpu: \"100m\"\n            memory: \"128Mi\"\n        livenessProbe:\n          httpGet:\n            path: \u002Fhealth\n            port: 8000\n          initialDelaySeconds: 30\n          periodSeconds: 10\n          timeoutSeconds: 5\n          failureThreshold: 3\n          successThreshold: 1\n        readinessProbe:\n          httpGet:\n            path: \u002Fready\n            port: 8000\n          initialDelaySeconds: 5\n          periodSeconds: 5\n          timeoutSeconds: 3\n          failureThreshold: 3\n          successThreshold: 1\n        startupProbe:\n          httpGet:\n            path: \u002Fhealth\n            port: 8000\n          failureThreshold: 30\n          periodSeconds: 10\n        securityContext:\n          allowPrivilegeEscalation: false\n          readOnlyRootFilesystem: false\n          capabilities:\n            drop:\n            - ALL\n        volumeMounts:\n        - name: tmp\n          mountPath: \u002Ftmp\n        - name: cache\n          mountPath: \u002Fcache\n      volumes:\n      - name: tmp\n        emptyDir: {}\n      - name: cache\n        emptyDir: {}\n      imagePullSecrets:\n      - name: registry-secret\n      serviceAccountName: restricted-sa\n      automountServiceAccountToken: false\n\n---\n# manifests\u002Fservice-account.yaml\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: restricted-sa\n  namespace: production\n  annotations:\n    iam.gke.io\u002Fgcp-service-account: \"production-sa@your-project.iam.gserviceaccount.com\"\n    eks.amazonaws.com\u002Frole-arn: \"arn:aws:iam::123456789012:role\u002Fproduction-role\"\n\n---\n# manifests\u002Fpod-security-policy.yaml\napiVersion: policy\u002Fv1beta1\nkind: PodSecurityPolicy\nmetadata:\n  name: restricted-psp\n  namespace: production\nspec:\n  privileged: false\n  allowPrivilegeEscalation: false\n  requiredDropCapabilities:\n    - ALL\n  volumes:\n    - 'configMap'\n    - 'emptyDir'\n    - 'projected'\n    - 'secret'\n    'downwardAPI'\n    'persistentVolumeClaim'\n  runAsUser:\n    rule: 'MustRunAsNonRoot'\n  seLinux:\n    rule: 'RunAsAny'\n  fsGroup:\n    rule: 'RunAsAny'\n```\n\n### 4. Service Mesh with Istio\n\n```yaml\n# istio\u002Fistio-config.yaml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: istio-config\n  namespace: istio-system\ndata:\n  meshConfig: |\n    accessLogFile: \u002Fdev\u002Fstdout\n    defaultConfig:\n      concurrency: 3\n      circuitBreakers:\n        consecutive5xxErrors: 5\n        timeout: 30s\n        maxConnections: 1000\n        maxRequestsPerConnection: 500\n      connectionPoolSettings:\n        tcp:\n          maxConnections: 100\n          connectTimeout: 10s\n        http:\n          http2MaxRequests: 100\n          maxRequestsPerConnection: 10\n          maxRetries: 3\n      outlierDetection:\n        consecutiveGatewayErrors: 5\n        interval: 30s\n        baseEjectionTime: 30s\n        maxEjectionPercent: 100\n      proxyStatsMatcher: \"-x\"\n      telemetry:\n        v2:\n          prometheus:\n            enabled: true\n            customTags:\n              app: \"secure-app\"\n              version: \"v1\"\n\n---\n# istio\u002Fdestination-rule.yaml\napiVersion: networking.istio.io\u002Fv1beta1\nkind: DestinationRule\nmetadata:\n  name: secure-app\n  namespace: production\nspec:\n  host: secure-app\n  trafficPolicy:\n    tls:\n      mode: ISTIO_MUTUAL\n      clientCertificate:\n        - \u002Fetc\u002Fistio\u002Fdestination-client-certs\n    connectionPool:\n      tcp:\n        maxConnections: 100\n        connectTimeout: 30s\n        keepAlive:\n          time: 7200s\n          requests: 10000\n      http:\n        http2MaxRequests: 1000\n        maxRequestsPerConnection: 100\n        maxRetries: 3\n        idleTimeout: 120s\n        h2UpgradePolicy: RFC\n        keepAlive:\n          time: 7200s\n          requests: 100\n    loadBalancer:\n      simple: LEAST_CONN\n    circuitBreaker:\n      consecutiveErrors: 7\n      interval: 30s\n      baseEjectionTime: 30s\n      maxEjectionPercent: 100\n    outlierDetection:\n      consecutive5xxErrors: 5\n      interval: 30s\n      baseEjectionTime: 30s\n      maxEjectionPercent: 10\n    retryOn:\n      - connect-failure\n      - refused-stream\n      - canceled\n      - timeout\n      - retriable-status\n    retryOff:\n      - overloaded\n      - deadline-exceeded\n      - unknown\n    timeout: 300s\n    tls:\n      mode: ISTIO_MUTUAL\n  subsets:\n  - name: v1\n    labels:\n      version: v1\n    trafficPolicy:\n      loadBalancer:\n        leastRequestConn: 100\n      connectionPool:\n        tcp:\n          maxConnections: 10\n          connectTimeout: 10s\n          keepAlive:\n            time: 300s\n        http:\n          http1MaxPendingRequests: 10\n          maxRequestsPerConnection: 2\n          maxRetries: 2\n          idleTimeout: 60s\n      outlierDetection:\n        consecutiveErrors: 3\n        interval: 15s\n        baseEjectionTime: 15s\n        maxEjectionPercent: 10\n      timeout: 60s\n\n---\n# istio\u002Fvirtual-service.yaml\napiVersion: networking.istio.io\u002Fv1beta1\nkind: VirtualService\nmetadata:\n  name: secure-app\n  namespace: production\nspec:\n  hosts:\n  - secure-app.production.company.com\n  gateways:\n  - istio-system\u002Fingressgateway\n  http:\n  - match:\n    - uri:\n        prefix: \u002F\n    retries:\n      attempts: 3\n      perTryTimeout: 2s\n      retryOn: [5xx, connect-failure, refused-stream]\n    fault:\n      delay:\n        percentage:\n          value: 0\n        fixedDelay: 0s\n    timeout: 300s\n    route:\n    - destination:\n        host: secure-app\n        subset: v1\n    mirror:\n      host: secure-app\n      subset: v1\n      mirrorPercentage:\n        value: 5\n    http:\n    - match:\n      - headers:\n          canary: \"true\"\n      route:\n      - destination:\n          host: secure-app\n          subset: canary\n      weight: 10\n    http:\n    - route:\n      - destination:\n          host: secure-app\n          subset: v1\n      weight: 90\n```\n\n### 5. ArgoCD GitOps Configuration\n\n```yaml\n# argocd\u002Fapplication.yaml\napiVersion: argoproj.io\u002Fv1alpha1\nkind: Application\nmetadata:\n  name: secure-app\n  namespace: argocd\n  finalizers:\n  - resources-finalizer.argocd.argoproj.io\nspec:\n  project: default\n  source:\n    repoURL: https:\u002F\u002Fgithub.com\u002Fcompany\u002Fsecure-app-k8s\n    targetRevision: HEAD\n    path: kubernetes\u002Fproduction\n  destination:\n      server: https:\u002F\u002Fkubernetes.default.svc\n      namespace: production\n  syncPolicy:\n    automated:\n      prune: true\n      selfHeal: true\n      allowEmpty: false\n    syncOptions:\n    - CreateNamespace=true\n    - PruneLast=false\n    - PrunePropagationPolicy=foreground\n    retry:\n      limit: 5\n    backoff:\n      duration: 5s\n      factor: 2\n      maxDuration: 3m\n  ignoreDifferences:\n    - JSONPath: '.spec.template.spec.replicas'\n  revisionHistoryLimit: 10\n  plugins:\n  - name: argocd-image-updater\n    args:\n      - image-updater\n      - allow-tags\n      - kwok='image-tag: \"*\"'\n  - name: argocd-notifications\n    args:\n      - notifications\n      - service: slack\n      - slack-token: $SLACK_TOKEN\n  - name: argocd-cm\n    args:\n      - cm\n      - configMapName: argocd-cm\n      - configMapKey: config.yaml\n```\n\n### 6. Monitoring and Observability\n\n```yaml\n# monitoring\u002Fprometheus.yaml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: prometheus-config\n  namespace: monitoring\ndata:\n  prometheus.yml: |\n    global:\n      scrape_interval: 15s\n      evaluation_interval: 15s\n\n    rule_files:\n      - \"\u002Fetc\u002Fprometheus\u002Frules\u002F*.yml\"\n\n    scrape_configs:\n      - job_name: 'kubernetes-pods'\n        kubernetes_sd_configs:\n          - role: pod\n        relabel_configs:\n          - source_labels: [__meta_kubernetes_pod_label_name]\n            target_label: pod\n          - source_labels: [__meta_kubernetes_namespace]\n            target_label: namespace\n          - source_labels: [__meta_kubernetes_pod_label_app]\n            target_label: app\n          - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]\n            action: keep\n            regex: true\n            source_label: __meta_kubernetes_pod_annotation_prometheus_io_scrape\n            target_label: __meta_kubernetes_pod_annotation_prometheus_io_scrape\n        metric_relabel_configs:\n          - source_labels: [__name__]\n            regex: 'instance_.*'\n            target_label: instance\n          - action: labelmap\n            regex: 'pod_.*'\n            target_label: pod\n          - source_labels: [__name__]\n            regex: 'namespace_.*'\n            target_label: namespace\n          - source_labels: [__name__]\n            regex: 'workload_.*'\n            target_label: workload\n      - job_name: 'kubernetes-services'\n        kubernetes_sd_configs:\n          - role: service\n        relabel_configs:\n          - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]\n            action: keep\n            regex: true\n            source_label: __meta_kubernetes_service_annotation_prometheus_io_scrape\n            target_label: __meta_kubernetes_service_annotation_prometheus_io_scrape\n          - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]\n            action: keep\n            regex: true\n            source_label: __meta_kubernetes_service_annotation_prometheus_io_scheme\n            target_label: __meta_kubernetes_service_annotation_prometheus_io_scheme\n          - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]\n            action: keep\n            regex: true\n            source_label: __meta_kubernetes_service_annotation_prometheus_io_path\n            target_label: __meta_kubernetes_service_annotation_prometheus_io_path\n          - source_labels: [__meta_kubernetes_service_name]\n            target_label: kubernetes_name\n          - source_labels: [__meta_kubernetes_namespace]\n            target_label: kubernetes_namespace\n          - source_labels: [__meta_kubernetes_service_label]\n            target_label: kubernetes_name\n\n# Security rules\n---\napiVersion: v1\nkind: Secret\nmetadata:\n  name: prometheus-rules\n  namespace: monitoring\ntype: Opaque\nstringData:\n  security-alerts.yml: |\n    groups:\n    - name: security.rules\n      rules:\n        - alert: HighErrorRate\n          expr: rate(http_requests_total{job=\"kubernetes-pods\",status=\"5xx\"}[5m]) > 0.1\n          for: 5m\n          labels:\n            severity: \"critical\"\n          annotations:\n            summary: \"High error rate detected\"\n            description: \"Error rate is above 10% for 5 minutes\"\n            runbook_url: \"https:\u002F\u002Frunbooks.company.com\u002Fhigh-error-rate\"\n        - alert: UnauthorizedAccess\n          expr: rate(http_requests_total{status=\"401\"}[5m]) > 5\n          for: 5m\n          labels:\n            severity: \"warning\"\n          annotations:\n            summary: \"Unauthorized access attempts\"\n            description: \"More than 5 unauthorized requests per minute\"\n            runbook_url: \"https:\u002F\u002Frunbooks.company.com\u002Funauthorized-access\"\n        - alert: ContainerRestarts\n          expr: rate(kube_pod_container_status_restarts_total[15m]) > 3\n          for: 15m\n          labels:\n            severity: \"warning\"\n          annotations:\n            summary: \"Container restarts detected\"\n            description: \"Container has restarted more than 3 times in 15 minutes\"\n            runbook_url: \"https:\u002F\u002Frunbooks.company.com\u002Fcontainer-restarts\"\n```\n\n### 7. Production Deployment Checklist\n\n```yaml\n# deployment\u002Fproduction-checklist.yaml\nsecurity:\n  container_security:\n    minimal_base_image: true\n    minimal_packages: true\n    security_scanning: true\n    vulnerability_scanning: true\n    sbom_generation: true\n\n  runtime_security:\n    non_root_user: true\n    readonly_filesystem: false\n    capabilities_dropped_all: true\n    seccomp_enabled: true\n    apparmor_enabled: true\n    selinux_enabled: true\n\n  network_security:\n    network_policies: true\n    service_mesh: true\n    mtls_enabled: true\n    tls_version: \"1.3\"\n    certificate_rotation: true\n\n  secrets_management:\n    encrypted_secrets: true\n    key_rotation: true\n    secret_versioning: true\n    access_control: true\n\n  rbac:\n    principle_of_least_privilege: true\n    service_accounts_limited: true\n    token_min_ttl: true\n    token_autorenewal: false\n\n  compliance:\n    cis_benchmark: true\n    pod_security_standards: true\n    nist_controls: true\n    pci_dss: true\n    hipaa: true\n\nobservability:\n  monitoring:\n    metrics_collection: true\n    custom_metrics: true\n    alerting_enabled: true\n    dashboard_creation: true\n\n  logging:\n    structured_logging: true\n    log_aggregation: true\n    log_retention: true\n    sensitive_data_redaction: true\n\n  tracing:\n    distributed_tracing: true\n    span_sampling: true\n    performance_tracking: true\n    error_tracking: true\n\n  auditing:\n    api_audit_logging: true\n    system_event_logging: true\n    security_event_logging: true\n    compliance_reporting: true\n\nperformance:\n  resource_management:\n    resource_limits: true\n    resource_quotas: true\n    hpa_enabled: true\n    cluster_autoscaling: true\n\n  optimization:\n    image_optimization: true\n    caching_enabled: true\n    compression: true\n    connection_pooling: true\n    batch_processing: true\n\ndisaster_recovery:\n  backup_strategy:\n    automated_backups: true\n    backup_encryption: true\n    cross_region_backup: true\n    restore_testing: true\n\n  high_availability:\n    multi_zone_deployment: true\n    health_checks: true\n    auto_healing: true\n    graceful_shutdown: true\n    rolling_updates: true\n\n  testing:\n  security_testing:\n    penetration_testing: true\n    vulnerability_scanning: true\n    compliance_testing: true\n    chaos_testing: true\n\n  performance_testing:\n    load_testing: true\n    stress_testing: true\n    scalability_testing: true\n    reliability_testing: true\n```\n\nThis comprehensive Docker\u002FKubernetes skill provides security-first containerization and deployment patterns for 2025, including zero-trust architectures, service mesh integration, GitOps workflows, and production-ready security hardening that works across different cloud providers and meets modern compliance standards.",{"name":5,"license":15,"description":7},"master","63f17866001c5ca854bf2fa0b678ce277133de5b","skills\u002Fmarketplace\u002Fdocker-k8s",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill docker-k8s",{"tool":40,"command":41},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill docker-k8s",{"tool":43,"command":44},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill docker-k8s","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fdocker-k8s\u002FSKILL.md",true,[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"skill-report.json","REFERENCE","参考文档",38840,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fdocker-k8s\u002Fskill-report.json",[55,63,70,77,84,91],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":62},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":62},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":62},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":62},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":62},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":62},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]