Generate a sample YAML file from a CRD

Hello. This one is a quick update. Just a showcase really. I wrote a tool to generate a sample YAML file from a CRD. Given a CRD like this one, it would output a generate yaml sample like this: apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: {} spec: additionalTags: {} bastion: allowedCIDRBlocks: ["string"] ami: string disableIngressRules: true enabled: true instanceType: string controlPlaneEndpoint: host: string port: 1 controlPlaneLoadBalancer: additionalSecurityGroups: ["string"] crossZoneLoadBalancing: true healthCheckProtocol: string name: string scheme: string subnets: ["string"] identityRef: kind: AWSCluster name: string imageLookupBaseOS: string imageLookupFormat: string imageLookupOrg: string network: cni: cniIngressRules: - description: string fromPort: 1 protocol: string toPort: 1 securityGroupOverrides: {} subnets: - availabilityZone: string cidrBlock: string id: string ipv6CidrBlock: string isIpv6: true isPublic: true natGatewayId: string routeTableId: string tags: {} vpc: availabilityZoneSelection: string availabilityZoneUsageLimit: 1 cidrBlock: string id: string internetGatewayId: string ipv6: cidrBlock: string egressOnlyInternetGatewayId: string poolId: string tags: {} region: string s3Bucket: controlPlaneIAMInstanceProfile: string name: string nodesIAMInstanceProfiles: ["string"] sshKeyName: string status: bastion: addresses: - address: string type: string availabilityZone: string ebsOptimized: true enaSupport: true iamProfile: string id: string imageId: string instanceState: string networkInterfaces: ["string"] nonRootVolumes: - deviceName: string encrypted: true encryptionKey: string iops: 1 size: 1 throughput: 1 type: string privateIp: string publicIp: string rootVolume: deviceName: string encrypted: true encryptionKey: string iops: 1 size: 1 throughput: 1 type: string securityGroupIds: ["string"] spotMarketOptions: maxPrice: string sshKeyName: string subnetId: string tags: {} tenancy: string type: string userData: string volumeIDs: ["string"] conditions: - lastTransitionTime: string message: string reason: string severity: string status: string type: string failureDomains: {} networkStatus: apiServerElb: attributes: crossZoneLoadBalancing: true idleTimeout: 1 availabilityZones: ["string"] dnsName: string healthChecks: healthyThreshold: 1 interval: 1 target: string timeout: 1 unhealthyThreshold: 1 listeners: - instancePort: 1 instanceProtocol: string port: 1 protocol: string name: string scheme: string securityGroupIds: ["string"] subnetIds: ["string"] tags: {} securityGroups: {} ready: true The link to the repo is here. Enjoy. ...

October 19, 2022 · 2 min · hannibal

Summary of Common Sense guide to Data Structures and Algorithms

Hello! I’ve been working on something extensive these days. Like my Grokking Algorithms summary, I now moved on to read Common-Sense Guide to Data Structures and Algorithms. As with Grokking, I created a Go based repo and added notes for each chapter. The repo can be located here. Enjoy, and thanks for reading. Gergely.

September 25, 2022 · 1 min · hannibal

How to contribute to a new repository

How to contribute to a new repository Hello Dear readers. Today, I’m going to walk you through a process of contributing into a new repository. If you are new to Go development and would like to contribute somewhere but are at a loss in large repositories, this post will be for you. I selected the top repository in trending Go today. Which is istio. I think that’s sufficiently large and I have no idea about the repository, so I’m going to walk you through my process. I did choose a repo that is in the area of my expertise though so I have an easier time deciphering what it is trying to do in the first place. ...

July 1, 2022 · 6 min · hannibal

Hacking on CAPA - The journey of implementing a nontrivial feature in a barely known codebase

Hacking on CAPA - The journey of implementing a nontrivial feature in a barely known codebase Hello Dear readers. Today, I would like to write about a project I’ve been working on these past months or so. This is a longer story and hopefully an interesting one to read. I’m going to write about the journey I took while trying to implement IPv6 based Kubernetes cluster for CAPA and EKS. The interesting points of this journey are twofold. First, understanding IPv6 in AWS land and how it’s configured and how it works. What are it’s limitations and requirements? Topology, routing, security groups, launch configuration, IAM roles, node policies… etc. ...

June 26, 2022 · 14 min · hannibal

Dependabot Bundler

Hello Dear readers. Today, I would like to write about a small pet project of mine called Dependabot Bundler. We’ve all been here: You would like to review these individually, of course, however, having to individually merge them is quite the pain. Isn’t it a lot better to do this instead? A lot nicer and more comfortable, isn’t it? This is done by running dependabot-bundler with the following command: ...

May 16, 2022 · 1 min · hannibal

Reader's Digest - January with Grokking Algorithms Go Generics Repository

Hello Dear readers. Today’s reader’s digest comes with a repo and some code too! Let’s dive in. Reader’s Digest - January Immune Immune is an absolutely fabulous book. It’s amazing and in time of this pandemic a healthy read to boot. I love biology, but never went too deep into it. This book fascinated me with its colorful images, the style of Kurzgesagt story telling and the man himself, who is the voice of Kurzgesagt. I’ve read it all with his voice in my head. ...

January 26, 2022 · 3 min · hannibal

Providers Pattern

Hello Dear readers. Today, I would like to write about a project design pattern I’ve been using successfully over the past years for various projects. It has many variations and it has some design patterns that are commonly found in the wild, so there is nothing really special about it. Let’s begin. Providers Pattern What is this pattern anyways? It’s a pattern I learned while working at ArangoDB. It’s quite nice and defines package abstractions wonderfully. It somewhat resembles the Repository pattern from DDD and also uses Chain of Responsibility to setup multiple providers for a given functionality. Like a fallback, in case a Provider does not understand the current thing it got. In that case, it will delegate to Next. ...

December 21, 2021 · 9 min · hannibal

Advent Of Code - Day 12 - Updated

Advent Of Code - Day 12 - Updated A comment from one of my readers prompted me to revise my solution on this trying to do part 2. The suggestions was that instead of using a struct as seen, use int and keep track of the count for small caves that way. I started to do that but got into various problems along the way when I got frustrated with my code, deleted the whole thing and begun again. But this lead me to a small, and better code than before which actually worked. ...

December 17, 2021 · 7 min · hannibal

Advent Of Code - Day 15

Advent Of Code - Day 15 Today, again, we open up Red Blob Games. It is a great source of information and descriptions. Especially, since this scenario is right up Red Blob’s ally. We need some weighted path finding. And Red Blob has a lovely post on that using the ever famous Dijkstra algorithm with a Priority Queue. Day 15 - Part 1 Let’s get to it. After refreshing my memory about priority queues, I remembered that there is a package and some sample code in Go which implements priority queues using the container/heap package here. ...

December 15, 2021 · 5 min · hannibal

Advent Of Code - Day 14

Advent Of Code - Day 14 Now we have to do some chemistry. Santa is pretty cool this way. They have a lot of skills mastered and read manuals like an expert. But this also means that manuals are always faulty. But Santa manages to work around these problems rather well. Day 14 - Part 1 So, by reading the description and looking at the outcome, that a string only after 5 iterations will be this big, begs the question if we should build a primitive solution for this. Well, yes, I think we should. Part 2 will most likely be about something like, okay, now do this, but longer. I suspect this will be like the lanterfish thing. But let’s do it anyways. ...

December 14, 2021 · 4 min · hannibal