{"id":17877822,"url":"https://github.com/ropes/k8s-trailhead","last_synced_at":"2025-03-22T05:31:34.490Z","repository":{"id":64307400,"uuid":"113588195","full_name":"Ropes/k8s-trailhead","owner":"Ropes","description":"k8s-trailhead is intended to be a starting point for any engineers who are interested in interacting with Kubernetes via the Golang client-go library instead of mountains of bash scripts. ","archived":false,"fork":false,"pushed_at":"2018-01-27T02:11:30.000Z","size":23785,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T08:48:19.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ropes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-08T15:25:12.000Z","updated_at":"2023-03-17T14:39:31.000Z","dependencies_parsed_at":"2023-01-15T11:00:54.049Z","dependency_job_id":null,"html_url":"https://github.com/Ropes/k8s-trailhead","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ropes%2Fk8s-trailhead","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ropes%2Fk8s-trailhead/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ropes%2Fk8s-trailhead/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ropes%2Fk8s-trailhead/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ropes","download_url":"https://codeload.github.com/Ropes/k8s-trailhead/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244912800,"owners_count":20530764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T11:59:07.779Z","updated_at":"2025-03-22T05:31:29.481Z","avatar_url":"https://github.com/Ropes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"k8s-trailhead\n-------------\n\n\nThis project aims to be a starting point for Kubernetes Users who are curious about interacting with the Kubernetes API via the [client-go](https://github.com/kubernetes/client-go) library. Inspired by the lead of Kelsey Hightower's [Kubernetes the hard way](https://github.com/kelseyhightower/kubernetes-the-hard-way) and Jessie Frazelle's [Kubernetes Snowflake](https://github.com/jessfraz/k8s-snowflake) project.  \n\nInteracting directly with the Kubernetes API enables programatic controls of resources and clean definition of procedures. \n\nThis project was originally demoed at 2017 Kubecon Austin in the talk \"Oregon Trial to Kubernetes\".(Demo gods were gracious, nerves less so.. attempting attonement for a shaky talk). \n\n## Why\n\nthe `client-go` library can be rough to get up and running with. Dependencies are the primary problem, and structure layout has changed between versions.\n\n`client-go` version `v5.x` has landed with strong support for Kubernetes 1.8, and hopefully is the beginning of smooth client upgrades going forward.\n\n## Vendoring\n\nThis project chooses to use [dep](https://github.com/golang/dep) as the dependency manager. This does have some [issues](https://github.com/kubernetes/client-go/blob/master/INSTALL.md#dep-not-supported-yet), but it works for the mainline cases. Supposedly the issues arise when utilizing the RBAC types which pull dependencies which cannot be flattened for the vendor directory.\n\nFor the mainline features, starting with the `Gopkg.toml` should work, copy it into other projects as a starting point. Once you've started writing yourown project, `dep ensure` to get the required packages vendored. `dep` is working on the [issue](https://github.com/golang/dep/issues/1124), although it's a [transitive dependency](https://github.com/golang/dep/issues/1124#issuecomment-333457621) issue, which is very [complex](https://github.com/golang/dep/issues/1124#issuecomment-331346439).\n\nThe `Gopkg.toml` locks client-go to `v6.0.0` and Kubernetes libraries to `kubernetes-1.9.0`. If you encounter any issues, please report them here and I'll try to resolve them and provide feedback upstream to `dep` if it's additional information.\n\n## Showcase\n\n### Deployment Object Specification\n\n[Deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) are a core part object in Kubernetes. Typically defined in YAML, but if the desire is to build a set of Deployments with parameterized differences; YAML templating can be tricky to validated and test without dropping out to bash. The [Operator pattern](https://coreos.com/blog/introducing-operators.html) pioneered by CoreOS takes advantage of the Go client library and attempts to solve stateful problems with minimal manual intervention/management.\n\n### End to End Testing\n\nThis runs a full integration test of a nginx(or whatever image you like) Deployment being created, tested for operation, and then cleanup. No bash, pipes, kubectl, or YAML involved!\n\nRequirements: \n* [minikube](https://github.com/kubernetes/minikube) up and running.\n* `export TESTMINIKUBE=1` to enable integration test.\n\nExecute Simple E2E Test:\n\n`go test ./kubernetes/... -v -run TestSimpleDeployE2E`\n\n## Trailmap(TODO)\n\n### Operators\n\nWork through a simple case of [CoreOS's Operator](https://coreos.com/operators/) pattern:\n1. Observe\n2. Analyze\n3. Act\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropes%2Fk8s-trailhead","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropes%2Fk8s-trailhead","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropes%2Fk8s-trailhead/lists"}