Rancher Support Matrix CLI Helper
A tool to bring the Rancher Support Matrix info into your CLI.
> Update: This project was not completed during hackweek 22, however will still continue development as possible and our team is excited to continue the efforts next year! We did make significant progress on both: a) producing a JSON static API scheme and b) a system to store the Rancher release version support information.
Project Description
The goal of this tool (for V1) is quite simply to pull up the Support Matrix info based on user input.
Project Components
CLI Tool - GoLang
This is the meat and potatoes of the Hackweek project. The other parts are important, but are all a means to this end.
The goal is to build it in Go so as to provide a native binary for each platform. This also keeps things close to K8s and Rancher, as opposed to Rust or other popular CLI languages.
Support Matrix Structured Data/API
This component is the data backing the CLI tool - it will be provided as a blob of structured data hosted on GH pages.
In a strict sense this (mostly) static data will function as if it were an API - however it is not interactive at all. It will simply be a statically rendered blob of data hosted online. So only pure GET requests rather than all the HTTP verbs like a true API. The final Scheme of this "API" has not been decided yet - however it will be informed by the needs of the CLI tool.
Matrix Refresh Tool
This component will be used to keep the publish Support Matrix Structured Data fresh and in sync.
Currently the data is not published in a way that is structured. This means we need to either: a) manually massage the data into the right formats, or b) create a system to sync that information. This tool is currently the furthest developed part of the project - having a mostly working proof of concept completed.
It is unlikely that this tool will be published in the open. It merely exists as an "internal" tool to facilitate publishing the data in a structured way. Similarly, this tool is least likely to need collaboration for Hackweek as the other components are the real goal.
Inspiration
As a Premium Support Engineer focused on Rancher we often need to review the support matrix. This is critical to ensure the Rancher instance is properly configured within the expected versions. While doing this via the webpage is fine, as tech staff we often spend a lot of time in CLIs. To that end bringing this essential tool even closer to our "main workflows" is a no brainer.
Mentioned above, the initial goal of hack week is simply to provide the information via CLI report. While more could potentially be achieved within Hackweek, this conservative goal was selected to allow enough time to organize the data at hand. The project will be in much better footing when this data is organized and refresh methods established.
Down the road it can be expanded to provide more functionality. E.g. Validation mode - enter all the versions in use and it will highlight potential issues, Upgrade Path - input current versions and desired Rancher version.
Goal for this Hackweek
- Establish a structured data source for Support Matrix,
- Publish (to GitHub pages) the structured data version of Support Matrix,
- Create a (golang) CLI tool to provide Support matrix info.
Resources
- Support Matrix Pages - The data we're structuring.
- Kontainer Metadata - Used by rancher internally, mainly for downstream clusters.
- Rancher Support Matrix API GH Pages - Eventual location of "api".
This project is part of:
Hack Week 21
Activity
Comments
-
over 2 years ago by dpock | Reply
Just wanted to give a brief update on the progress as it's mid-week already.
Ian and Myself have been working together on the design for the "structured data" version of the matrix. Our hope is that we will be able to land on a good format to export that as and publish a few versions worth of the data. Then start working on the golang CLI client that is the "real end goal".
Even though these parts I've been working on are just "bootstrap" work to get the CLI project started it's been great learning. I've updated the project info a bit to reflect some changes. I also published a mermaidjs diagram of the DB design being used for the CLI import tool here - https://gist.github.com/mallardduck/6bc19ed05029132370b8dda6b603f99e.
-
over 2 years ago by dpock | Reply
Here is an example of the API we created for the "index":
○ → curl http://rancher-support-matrix-full.test/ |jq { "about": "This is a static API that contains the Support information for Rancher releases!", "base_url": "http://rancher-support-matrix-full.test", "routes": { "api.rancherRelease": "api/release/{rancherRelease}.json", "api.rancherRelease.rkeK8sRuntimes": "api/release/{rancherRelease}/RkeK8sRuntimes.json", "api.rancherRelease.rkeK8sRuntimePair": "api/release/{rancherRelease}/RkeK8sRuntimePair.json", "api.rancherRelease.rkeDistroVersionDockerPair": "api/release/{rancherRelease}/RkeDistroVersionDockerPair.json", "api.rancherRelease.hostedRuntimes": "api/release/{rancherRelease}/HostedRuntimeVersions.json" }, "rancherReleases": [ { "data": { "version": "2.6.3" }, "links": { "self": "http://rancher-support-matrix-full.test/api/release/2.6.3.json" } } ] }
-
over 2 years ago by dpock | Reply
And here is one for the 2.6.3 release -note it's not complete and only includes RKE and hosted runtime info:
○ → curl http://rancher-support-matrix-full.test/api/release/2.6.3.json |jq { "data": { "version": "2.6.3" }, "relationships": { "rkeK8sRuntimes": { "data": [ { "version": "v1.21.7" }, { "version": "v1.20.13" }, { "version": "v1.19.16" }, { "version": "v1.18.20" } ], "links": { "self": "http://rancher-support-matrix-full.test/api/release/2.6.3/RkeK8sRuntimes.json" } }, "rkeCliRuntimePairs": [ { "data": { "cli": "v1.3.3", "k8sRuntime": "v1.21.7" } }, { "data": { "cli": "v1.3.3", "k8sRuntime": "v1.20.13" } }, { "data": { "cli": "v1.3.3", "k8sRuntime": "v1.19.16" } }, { "data": { "cli": "v1.3.3", "k8sRuntime": "v1.18.20" } } ], "rkeDistroVersionDockerPair": [ { "data": { "distro": "centos", "version": "7.7", "docker": "19.03.x" } }, { "data": { "distro": "centos", "version": "7.7", "docker": "20.10.x" } }, { "data": { "distro": "centos", "version": "7.8", "docker": "19.03.x" } }, { "data": { "distro": "centos", "version": "7.8", "docker": "20.10.x" } }, { "data": { "distro": "centos", "version": "7.9", "docker": "19.03.x" } }, { "data": { "distro": "centos", "version": "7.9", "docker": "20.10.x" } }, { "data": { "distro": "centos", "version": "8.3", "docker": "19.03.x" } }, { "data": { "distro": "centos", "version": "8.3", "docker": "20.10.x" } }, { "data": { "distro": "centos", "version": "8.4", "docker": "19.03.x" } }, { "data": { "distro": "centos", "version": "8.4", "docker": "20.10.x" } }, { "data": { "distro": "rocky-linux", "version": "8.4", "docker": "19.03.x" } }, { "data": { "distro": "rocky-linux", "version": "8.4", "docker": "20.10.x" } }, { "data": { "distro": "oracle-linux", "version": "7.7", "docker": "19.03.x" } }, { "data": { "distro": "oracle-linux", "version": "7.7", "docker": "20.10.x" } }, { "data": { "distro": "oracle-linux", "version": "7.9", "docker": "19.03.x" } }, { "data": { "distro": "oracle-linux", "version": "7.9", "docker": "20.10.x" } }, { "data": { "distro": "oracle-linux", "version": "8.2", "docker": "19.03.x" } }, { "data": { "distro": "oracle-linux", "version": "8.2", "docker": "20.10.x" } }, { "data": { "distro": "oracle-linux", "version": "8.3", "docker": "19.03.x" } }, { "data": { "distro": "oracle-linux", "version": "8.3", "docker": "20.10.x" } }, { "data": { "distro": "oracle-linux", "version": "8.4", "docker": "19.03.x" } }, { "data": { "distro": "oracle-linux", "version": "8.4", "docker": "20.10.x" } }, { "data": { "distro": "rhel", "version": "7.7", "docker": "1.13.x" } }, { "data": { "distro": "rhel", "version": "7.7", "docker": "19.03.x" } }, { "data": { "distro": "rhel", "version": "7.7", "docker": "20.10.x" } }, { "data": { "distro": "rhel", "version": "7.8", "docker": "1.13.x" } }, { "data": { "distro": "rhel", "version": "7.8", "docker": "19.03.x" } }, { "data": { "distro": "rhel", "version": "7.8", "docker": "20.10.x" } }, { "data": { "distro": "rhel", "version": "7.9", "docker": "1.13.x" } }, { "data": { "distro": "rhel", "version": "7.9", "docker": "19.03.x" } }, { "data": { "distro": "rhel", "version": "7.9", "docker": "20.10.x" } }, { "data": { "distro": "rhel", "version": "8.2", "docker": "19.03.x" } }, { "data": { "distro": "rhel", "version": "8.2", "docker": "20.10.x" } }, { "data": { "distro": "rhel", "version": "8.3", "docker": "19.03.x" } }, { "data": { "distro": "rhel", "version": "8.3", "docker": "20.10.x" } }, { "data": { "distro": "rhel", "version": "8.4", "docker": "19.03.x" } }, { "data": { "distro": "rhel", "version": "8.4", "docker": "20.10.x" } }, { "data": { "distro": "sles", "version": "12 SP5", "docker": "19.03.x" } }, { "data": { "distro": "sles", "version": "12 SP5", "docker": "20.10.x" } }, { "data": { "distro": "sles", "version": "15SP1", "docker": "19.03.x" } }, { "data": { "distro": "sles", "version": "15SP1", "docker": "20.10.x" } }, { "data": { "distro": "sles", "version": "15SP2", "docker": "19.03.x" } }, { "data": { "distro": "sles", "version": "15SP2", "docker": "20.10.x" } }, { "data": { "distro": "sles", "version": "15SP3", "docker": "19.03.x" } }, { "data": { "distro": "sles", "version": "15SP3", "docker": "20.10.x" } }, { "data": { "distro": "opensuse-leap", "version": "15.3", "docker": "19.03.x" } }, { "data": { "distro": "opensuse-leap", "version": "15.3", "docker": "20.10.x" } }, { "data": { "distro": "ubuntu", "version": "18.04", "docker": "19.03.x" } }, { "data": { "distro": "ubuntu", "version": "18.04", "docker": "20.10.x" } }, { "data": { "distro": "ubuntu", "version": "20.04", "docker": "19.03.x" } }, { "data": { "distro": "ubuntu", "version": "20.04", "docker": "20.10.x" } } ], "hostedRuntimeVersions": { "data": [ { "provider": "aks", "version": "v1.20.9" }, { "provider": "eks", "version": "v1.20.x" }, { "provider": "gke", "version": "v1.21.5-gke.1302" } ], "links": { "self": "http://rancher-support-matrix-full.test/api/release/2.6.3/HostedRuntimeVersions.json" } } }, "links": { "self": "http://rancher-support-matrix-full.test/api/release/2.6.3.json" } }
Similar Projects
Introducing "Bottles": A Proof of Concept for Multi-Version CRD Management in Kubernetes by aruiz
Description
As we delve deeper into the complexities of managing multiple CRD versions within a single Kubernetes cluster, I want to introduce "Bottles" - a proof of concept that aims to address these challenges.
Bottles propose a novel approach to isolating and deploying different CRD versions in a self-contained environment. This would allow for greater flexibility and efficiency in managing diverse workloads.
Goals
- Evaluate Feasibility: determine if this approach is technically viable, as well as identifying possible obstacles and limitations.
- Reuse existing technology: leverage existing products whenever possible, e.g. build on top of Kubewarden as admission controller.
- Focus on Rancher's use case: the ultimate goal is to be able to use this approach to solve Rancher users' needs.
Resources
Core concepts:
- ConfigMaps: Bottles could be defined and configured using ConfigMaps.
- Admission Controller: An admission controller will detect "bootled" CRDs being installed and replace the resource name used to store them.
- Aggregated API Server: By analyzing the author of a request, the aggregated API server will determine the correct bottle and route the request accordingly, making it transparent for the user.
CVE portal for SUSE Rancher products by gmacedo
Description
Currently it's a bit difficult for users to quickly see the list of CVEs affecting images in Rancher, RKE2, Harvester and Longhorn releases. Users need to individually look for each CVE in the SUSE CVE database page - https://www.suse.com/security/cve/ . This is not optimal, because those CVE pages are a bit hard to read and contain data for all SLE and BCI products too, making it difficult to easily see only the CVEs affecting the latest release of Rancher, for example. We understand that certain costumers are only looking for CVE data for Rancher and not SLE or BCI.
Goals
The objective is to create a simple to read and navigate page that contains only CVE data related to Rancher, RKE2, Harvester and Longhorn, where it's easy to search by a CVE ID, an image name or a release version. The page should also provide the raw data as an exportable CSV file.
It must be an MVP with the minimal amount of effort/time invested, but still providing great value to our users and saving the wasted time that the Rancher Security team needs to spend by manually sharing such data. It might not be long lived, as it can be replaced in 2-3 years with a better SUSE wide solution.
Resources
- The page must be simple and easy to read.
- The UI/UX must be as straightforward as possible with minimal visual noise.
- The content must be created automatically from the raw data that we already have internally.
- It must be updated automatically on a daily basis and on ad-hoc runs (when needed).
- The CVE status must be aligned with VEX.
- The raw data must be exportable as CSV file.
- Ideally it will be written in Go or pure Shell script with basic HTML and no external dependencies in CSS or JS.
Enabling Rancher as an OIDC Provider by rcabello
Description
Kubernetes supports OpenID Connect (OIDC) natively as an authentication mechanism, enabling token-based user authentication. This can be configured through flags in the Kubernetes API server or by using AuthenticationConfiguration.
The purpose of this project is to enable Rancher to function as an OIDC provider, allowing Rancher's local cluster to act as an OIDC identity provider for downstream clusters. This setup will allow users to authenticate directly with downstream clusters without relying on Rancher’s proxy and impersonation mechanisms.
Rancher will continue to support all authentication providers. When a user attempts to log in via the Rancher OIDC provider, they will be redirected to the authentication provider configured in Rancher.
This approach also facilitates integration with third-party tools (e.g StackState)
Goals
- Implement Rancher as an OIDC provider using the ORY Fosite library, focusing only on the essential functionality required for basic integration.
- Enable downstream clusters to authenticate using JWT tokens issued by Rancher.
- Configure StackState to authenticate using Rancher as an OIDC provider.
Resources
https://github.com/ory/fosite
Longhorn UI Extension (POC) by yiya.chen
Description
The goal is to create a Longhorn UI extension within Rancher using existing resources.
Longhorn’s UI is built using React, while Rancher’s UI extensions are built using Vue. Developers will explore different approaches to integrate and extend Longhorn’s UI within Rancher’s Vue-based ecosystem, aiming to create a seamless, functional UI extension.
Goals
- Build a Longhorn UI extension (look and feel)
- Support theme switching to align with Rancher’s UI
Results
- https://github.com/a110605/longhorn-hackday
- https://github.com/a110605/longhorn-ui/tree/darkmode
- https://github.com/houhoucoop/hackweek/tree/main/hackweek24
Resources
- Longhorn UI: https://github.com/longhorn/longhorn-ui
- Rancher UI Extension: https://extensions.rancher.io/extensions/next/home
- darkreader: https://www.npmjs.com/package/darkreader
- veaury: https://github.com/gloriasoft/veaury
- module federation: https://webpack.js.org/concepts/module-federation/
Rancher/k8s Trouble-Maker by tonyhansen
Project Description
When studying for my RHCSA, I found trouble-maker, which is a program that breaks a Linux OS and requires you to fix it. I want to create something similar for Rancher/k8s that can allow for troubleshooting an unknown environment.
Goal for this Hackweek
Create a basic framework for creating Rancher/k8s cluster lab environments as needed for the Break/Fix Create at least 5 modules that can be applied to the cluster and require troubleshooting
Resources
https://github.com/rancher/terraform-provider-rancher2 https://github.com/rancher/tf-rancher-up
Implement a CLI tool for Trento - trentoctl by nkopliku
Description
Implement a trentoctl
CLI for interacting with a trento installation
Goals
- learn rust
- implement an initial
trentoctl
tool to enhance trento automation - have fun
Resources
trento rust. TUIs listed on this other hackweek project Hack on rich terminal user interfaces
file-organizer: A CLI Tool for Efficient File Management by okhatavkar
Description
Create a Go-based CLI tool that helps organize files in a specified folder by sorting them into subdirectories based on defined criteria, such as file type or creation date. Users will pass a folder path as an argument, and the tool will process and organize the files within it.
Goals
- Develop Go skills by building a practical command-line application.
- Learn to manage and manipulate files and directories in Go using standard libraries.
- Create a tool that simplifies file management, making it easier to organize and maintain directories.
Resources
- Go Standard Libraries: Utilize os, filepath, and time for file operations.
- CLI Development: Use flag for basic argument parsing or consider cobra for enhanced functionality.
- Go Learning Material: Go by Example and The Go Programming Language Documentation.
Features
- File Type Sorting: Automatically move files into subdirectories based on their extensions (e.g., documents, images, videos).
- Date-Based Organization: Add an option to organize files by creation date into year/month folders.
- User-Friendly CLI: Build intuitive commands and clear outputs for ease of use. This version maintains the core idea of organizing files efficiently while focusing on Go development and practical file management.
Jenny Static Site Generator by adam.pickering
Description
For my personal site I have been using hugo. It works, but I am not satisfied: every time I want to make a change (which is infrequently) I have to read through the documentation again to understand how hugo works. I don't find the documentation easy to use, and the structure of the repository that hugo requires is unintuitive/more complex than what I need. So, I have decided to write my own simple static site generator in Go. It is named Jenny, after my wife.
Goals
- Pages can be written in markdown (which is automatically converted to HTML), but other file types are also allowed
- Easy to understand and use
- Intuitive, simple design
- Clear documentation
- Hot reloading
- Binaries provided for download
- Future maintenance is easy
- Automated releases
Resources
https://github.com/adamkpickering/jenny
Dartboard TUI by IValentin
Description
Our scalability and performance testing swiss-army knife tool Dartboard is a major WIP so why not add more scope creep? Dartboard is a cli tool which enables users to:
- Define a "Dart" config file as YAML which defines the various components to be created/setup when Dartboard runs its commands
- Spin up infrastructure utilizing opentofu/terraform providers
- Setup K3s or RKE2 clusters on the newly created infrastructure
- Deploy Rancher (with or without downstream cluster), rancher-monitoring (Grafana + Prometheus)
- Create resources in-bulk within the newly created Rancher cluster (ConfigMaps, Secrets, Users, Roles, etc.)
- Run various performance and scalability tests via k6
- Export/Import various tracked metrics (WIP)
Given all these features (and the features to come), it can be difficult to onboard and transfer knowledge of the tool. With a TUI, Dartboard's usage complexity can be greatly reduced!
Goals
- Create a TUI for Dartboard's "subcommands"
- Gain more familiarity with Dartboard and create a more user-friendly interface to enable others to use it
- Stretch Create a TUI workflow for generating a Dart file
Resources
https://github.com/charmbracelet/bubbletea
suse-rancher-supportconfig by eminguez
Description
Update: Live at https://github.com/e-minguez/suse-rancher-supportconfig I finally didn't used golang but used gum instead
SUSE's supportconfig
support tool collects data from the SUSE Operating system. Rancher's rancher2_logs_collector.sh
support tool does the same for RKE2/K3s.
Wouldn't be nice to have a way to run both and collect all data for SUSE based RKE2/K3s clusters? Wouldn't be even better with a fancy TUI tool like bubbletea?
Ideally the output should be an html page where you can see the logs/data directly from the browser.
Goals
- Familiarize myself with both
supportconfig
andrancher2_logs_collector.sh
tools - Refresh my golang knowledge
- Have something that works at the end of the hackweek ("works" may vary )
- Be better in naming things
Resources
All links provided above as well as huh
FamilyTrip Planner: A Personalized Travel Planning Platform for Families by pherranz
Description
FamilyTrip Planner is an innovative travel planning application designed to optimize travel experiences for families with children. By integrating APIs for flights, accommodations, and local activities, the app generates complete itineraries tailored to each family’s unique interests and needs. Recommendations are based on customizable parameters such as destination, trip duration, children’s ages, and personal preferences. FamilyTrip Planner not only simplifies the travel planning process but also offers a comprehensive, personalized experience for families.
Goals
This project aims to: - Create a user-friendly platform that assists families in planning complete trips, from flight and accommodation options to recommended family-friendly activities. - Provide intelligent, personalized travel itineraries using artificial intelligence to enhance travel enjoyment and minimize time and cost. - Serve as an educational project for exploring Go programming and artificial intelligence, with the goal of building proficiency in both.
Resources
To develop FamilyTrip Planner, the project will leverage: - APIs such as Skyscanner, Google Places, and TripAdvisor to source real-time information on flights, accommodations, and activities. - Go programming language to manage data integration, API connections, and backend development. - Basic machine learning libraries to implement AI-driven itinerary suggestions tailored to family needs and preferences.
ddflare: (Dynamic)DNS management via Cloudflare API in Kubernetes by fgiudici
Description
ddflare is a project started a couple of weeks ago to provide DDNS management using v4 Cloudflare APIs: Cloudflare offers management via APIs and access tokens, so it is possible to register a domain and implement a DynDNS client without any other external service but their API.
Since ddflare allows to set any IP to any domain name, one could manage multiple A and ALIAS domain records. Wouldn't be cool to allow full DNS control from the project and integrate it with your Kubernetes cluster?
Goals
Main goals are:
- add containerized image for ddflare
- extend ddflare to be able to add and remove DNS records (and not just update existing ones)
- add documentation, covering also a sample pod deployment for Kubernetes
- write a ddflare Kubernetes operator to enable domain management via Kubernetes resources (using kubebuilder)
Available tasks and improvements tracked on ddflare github.
Resources
- https://github.com/fgiudici/ddflare
- https://developers.cloudflare.com/api/
- https://book.kubebuilder.io
Cluster API Add-on Provider for Kubewarden by csalas
Description
Can we integrate Kubewarden with Cluster API provisioning?
Cluster API is a Kubernetes project focused on providing declarative APIs and tooling to simplify provisioning, upgrading, and operating multiple Kubernetes clusters. TLDR; CAPI let's you define Kubernetes clusters in plain YAML, and CAPI providers (infrastructure, control plane/bootstrap, etc.) manage provisioning and configuration for you.
What if we could create an add-on provider that automatically installs Kubewarden and deploys Policy Servers to CAPI clusters?
Goals
- As a user I'd like to set a cluster (or list of clusters) and have the provider install Kubewarden for me.
- As a user I'd like to set what policies must be enforced for a cluster (or list of clusters).
Resources
- Cluster API: https://cluster-api.sigs.k8s.io/
- Kubewarden: https://docs.kubewarden.io/
Jenny Static Site Generator by adam.pickering
Description
For my personal site I have been using hugo. It works, but I am not satisfied: every time I want to make a change (which is infrequently) I have to read through the documentation again to understand how hugo works. I don't find the documentation easy to use, and the structure of the repository that hugo requires is unintuitive/more complex than what I need. So, I have decided to write my own simple static site generator in Go. It is named Jenny, after my wife.
Goals
- Pages can be written in markdown (which is automatically converted to HTML), but other file types are also allowed
- Easy to understand and use
- Intuitive, simple design
- Clear documentation
- Hot reloading
- Binaries provided for download
- Future maintenance is easy
- Automated releases
Resources
https://github.com/adamkpickering/jenny
Automate PR process by idplscalabrini
Description
This project is to streamline and enhance the pr review process by adding automation for identifying some issues like missing comments, identifying sensitive information in the PRs like credentials. etc. By leveraging GitHub Actions and golang hooks we can focus more on high-level reviews
Goals
- Automate lints and code validations on Github actions
- Automate code validation on hook
- Implement a bot to pre-review the PRs
Resources
Golang hooks and Github actions
Contribute to terraform-provider-libvirt by pinvernizzi
Description
The SUSE Manager (SUMA) teams' main tool for infrastructure automation, Sumaform, largely relies on terraform-provider-libvirt. That provider is also widely used by other teams, both inside and outside SUSE.
It would be good to help the maintainers of this project and give back to the community around it, after all the amazing work that has been already done.
If you're interested in any of infrastructure automation, Terraform, virtualization, tooling development, Go (...) it is also a good chance to learn a bit about them all by putting your hands on an interesting, real-use-case and complex project.
Goals
- Get more familiar with Terraform provider development and libvirt bindings in Go
- Solve some issues and/or implement some features
- Get in touch with the community around the project
Resources
- CONTRIBUTING readme
- Go libvirt library in use by the project
- Terraform plugin development
- "Good first issue" list
file-organizer: A CLI Tool for Efficient File Management by okhatavkar
Description
Create a Go-based CLI tool that helps organize files in a specified folder by sorting them into subdirectories based on defined criteria, such as file type or creation date. Users will pass a folder path as an argument, and the tool will process and organize the files within it.
Goals
- Develop Go skills by building a practical command-line application.
- Learn to manage and manipulate files and directories in Go using standard libraries.
- Create a tool that simplifies file management, making it easier to organize and maintain directories.
Resources
- Go Standard Libraries: Utilize os, filepath, and time for file operations.
- CLI Development: Use flag for basic argument parsing or consider cobra for enhanced functionality.
- Go Learning Material: Go by Example and The Go Programming Language Documentation.
Features
- File Type Sorting: Automatically move files into subdirectories based on their extensions (e.g., documents, images, videos).
- Date-Based Organization: Add an option to organize files by creation date into year/month folders.
- User-Friendly CLI: Build intuitive commands and clear outputs for ease of use. This version maintains the core idea of organizing files efficiently while focusing on Go development and practical file management.
kubectl clone: Seamlessly Clone Kubernetes Resources Across Multiple Rancher Clusters and Projects by dpunia
Description
kubectl clone is a kubectl plugin that empowers users to clone Kubernetes resources across multiple clusters and projects managed by Rancher. It simplifies the process of duplicating resources from one cluster to another or within different namespaces and projects, with optional on-the-fly modifications. This tool enhances multi-cluster resource management, making it invaluable for environments where Rancher orchestrates numerous Kubernetes clusters.
Goals
- Seamless Multi-Cluster Cloning
- Clone Kubernetes resources across clusters/projects with one command.
- Simplifies management, reduces operational effort.
Resources
Rancher & Kubernetes Docs
- Rancher API, Cluster Management, Kubernetes client libraries.
Development Tools
- Kubectl plugin docs, Go programming resources.
Building and Installing the Plugin
- Set Environment Variables: Export the Rancher URL and API token:
export RANCHER_URL="https://rancher.example.com"
export RANCHER_TOKEN="token-xxxxx:xxxxxxxxxxxxxxxxxxxx"
- Build the Plugin: Compile the Go program:
go build -o kubectl-clone ./pkg/
- Install the Plugin:
Move the executable to a directory in your
PATH
:
mv kubectl-clone /usr/local/bin/
Ensure the file is executable:
chmod +x /usr/local/bin/kubectl-clone
- Verify the Plugin Installation: Test the plugin by running:
kubectl clone --help
You should see the usage information for the kubectl-clone
plugin.
Usage Examples
- Clone a Deployment from One Cluster to Another:
kubectl clone --source-cluster c-abc123 --type deployment --name nginx-deployment --target-cluster c-def456 --new-name nginx-deployment-clone
- Clone a Service into Another Namespace and Modify Labels:
A CLI for Harvester by mohamed.belgaied
[comment]: # Harvester does not officially come with a CLI tool, the user is supposed to interact with Harvester mostly through the UI [comment]: # Though it is theoretically possible to use kubectl to interact with Harvester, the manipulation of Kubevirt YAML objects is absolutely not user friendly. [comment]: # Inspired by tools like multipass from Canonical to easily and rapidly create one of multiple VMs, I began the development of Harvester CLI. Currently, it works but Harvester CLI needs some love to be up-to-date with Harvester v1.0.2 and needs some bug fixes and improvements as well.
Project Description
Harvester CLI is a command line interface tool written in Go, designed to simplify interfacing with a Harvester cluster as a user. It is especially useful for testing purposes as you can easily and rapidly create VMs in Harvester by providing a simple command such as:
harvester vm create my-vm --count 5
to create 5 VMs named my-vm-01
to my-vm-05
.
Harvester CLI is functional but needs a number of improvements: up-to-date functionality with Harvester v1.0.2 (some minor issues right now), modifying the default behaviour to create an opensuse VM instead of an ubuntu VM, solve some bugs, etc.
Github Repo for Harvester CLI: https://github.com/belgaied2/harvester-cli
Done in previous Hackweeks
- Create a Github actions pipeline to automatically integrate Harvester CLI to Homebrew repositories: DONE
- Automatically package Harvester CLI for OpenSUSE / Redhat RPMs or DEBs: DONE
Goal for this Hackweek
The goal for this Hackweek is to bring Harvester CLI up-to-speed with latest Harvester versions (v1.3.X and v1.4.X), and improve the code quality as well as implement some simple features and bug fixes.
Some nice additions might be: * Improve handling of namespaced objects * Add features, such as network management or Load Balancer creation ? * Add more unit tests and, why not, e2e tests * Improve CI * Improve the overall code quality * Test the program and create issues for it
Issue list is here: https://github.com/belgaied2/harvester-cli/issues
Resources
The project is written in Go, and using client-go
the Kubernetes Go Client libraries to communicate with the Harvester API (which is Kubernetes in fact).
Welcome contributions are:
- Testing it and creating issues
- Documentation
- Go code improvement
What you might learn
Harvester CLI might be interesting to you if you want to learn more about:
- GitHub Actions
- Harvester as a SUSE Product
- Go programming language
- Kubernetes API
Install Uyuni on Kubernetes in cloud-native way by cbosdonnat
Description
For now installing Uyuni on Kubernetes requires running mgradm
on a cluster node... which is not what users would do in the Kubernetes world. The idea is to implement an installation based only on helm charts and probably an operator.
Goals
Install Uyuni from Rancher UI.
Resources
mgradm
code: https://github.com/uyuni-project/uyuni-tools- Uyuni operator: https://github.com/cbosdo/uyuni-operator