raynix 筆記

raynix 筆記

  • Home
  • WordPress Hosting
  • Side Quests
Illustration of a bird flying.
  • How to Provision Google Log-Based Metrics with Terraform and YAML

    TL; DR: here are my notes on provisioning Google log-based metrics using Terraform and YAML. The metrics are defined in YAML in a clean fashion and they will be created via terraform apply The HCL part for Terraform Ref.1, https://cloud.google.com/logging/docs/logs-based-metrics2, https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/logging_metric 🙂

    September 4, 2024
    Systems Admin
    Google Cloud, Terraform, yaml
  • Indexes for Structured Logs in Google Cloud

    TL; DR: Google Cloud accepts structured logs ingested from different sources but will not index fields automatically. So by default the ingested jsonPayload will not be optimised for query. Here’s how to add indexes to it using Terraform. 🙂

    August 23, 2024
    Systems Admin
    Google Cloud, logs
  • How to Prune Only Selected Fields in Jsonnet

    In Jsonnet’s standard libraries, there’s an std.prune function which will recursively go through an object and remove any empty field in the object which is quite handy, usually. In my case I wanted to prune all empty fields in a container object but spare the legit empty emptyDir field so the std.prune may cause some…

    August 14, 2024
    Systems Admin
    jsonnet
  • My New Favourite Editor is Neither VS Code Nor Atom

    I used to use Atom as my main editor but it somehow lost its popularity and withered sadly. Then I switched to VS Code which is also Electron based and similar to Atom in some ways. VSC was great until recently I heard about Zed, which I immediately felt excited about it, for a few…

    August 8, 2024
    Opensource
    IDE, Rust, Zed
  • How to Do Kubernetes Cronjobs with Sidecars Properly in 2024

    TL; DR: Since Kubernetes v1.28, there’s no need to do fancy bash scripts to kill your sidecar when the main container finishes. So using sidecars in Kubernetes Jobs or Cronjobs are now much simpler and more elegant too. For example, I wanted to run a database backup job in a GKE + Cloud SQL environment,…

    July 26, 2024
    Systems Admin
    cronjob, kubernetes, sidecar
  • Solved: Google Managed Prometheus Kept Crashing

    Context: I use Google Cloud Managed Service for Prometheus(GMP I call it for convenience) as the central piece of my observability stack. In a nut shell it’s Prometheus managed by Google. GMP runs a collector Prometheus pod in each node, as a DaemonSet. The collector Prometheus scrapes metrics within the node and forwards them to…

    July 15, 2024
    Systems Admin
    Google Cloud, prometheus
  • Coloured Diff With Python

    TL; DR: my simple Python code to output a result of text comparison in git-diff style Here’s the code snippet in Python. 🙂

    July 9, 2024
    Python & Frameworks
    diff, Python
  • How to Use Pod Anti-Affinity in Kubernetes

    By default the Kubernetes scheduler distributes pods of a replica set evenly to all nodes, if no taints are present of course. So why or when do we need pod anti-affinity? 1 scenario I can think of is like this: Without any advanced tuning such as pod anti-affinity, the replicas can possibly be scheduled like…

    July 4, 2024
    Systems Admin
    kubernetes
←Previous Page
1 2 3 4 5 6 … 109
Next Page→
  • Eric Lin’s Blog
  • Eddie Wang’s Blog at WP
  • GoalKeeper’s Blog

raynix 筆記

Just another WordPress blog

  • Facebook
  • Twitter
  • Instagram

Proudly powered by WordPress