Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dev-env): Setup local development environment using greenhousectl #452

Merged
merged 73 commits into from
Aug 29, 2024

Conversation

abhijith-darshan
Copy link
Contributor

@abhijith-darshan abhijith-darshan commented Aug 15, 2024

Description

Introduces a dev sub-command in greenhousectl CLI to bootstrap local development environment using KinD clusters.

  • Spins up a development environment using KinD clusters with a single command by providing a config.json

Additional commands to -

  • Apply manifests (Greenhouse CRDs, Dex CRDs...)
  • Deploy the manager in WEBHOOK_ONLY mode to focus on controller development locally
  • Modify and apply ValidatingWebhookConfiguration and MutatingWebhookConfiguration to do webhook development locally

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

KinD cluster creation functionality. Additionally, can get a kind cluster, list kind clusters
cluster command to create kind cluster and optionally create a namespace after cluster creation
manifests cmd explodes the specified chart by doing a helm template and applies it to the KinD cluster using kubectl apply
webhook command will deploy the operator to run in webhook only mode so that local development of controllers can be done without running webhooks. Validation and mutation of CR(s) will happen in-cluster
setup command uses a config file to spin up a full development environment
auto-generates docs for cobra commands
in order to reduce complexity and encourage contributions by end users, dev CLI commands are moved from standalone to greenhousectl
Makefile Outdated Show resolved Hide resolved
dev-env/localenv/README.md Outdated Show resolved Hide resolved
dev-env/localenv/README.md Outdated Show resolved Hide resolved
dev-env/localenv/README.md Show resolved Hide resolved
dev-env/localenv/README.md Outdated Show resolved Hide resolved
pkg/internal/local/utils/expect.go Outdated Show resolved Hide resolved
pkg/internal/local/setup/manifest.go Outdated Show resolved Hide resolved
pkg/internal/local/commands/setup.go Outdated Show resolved Hide resolved
pkg/internal/local/klient/docker.go Show resolved Hide resolved
pkg/internal/local/klient/kind.go Show resolved Hide resolved
Copy link
Contributor

@IvoGoman IvoGoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The NITs are merely style, non-blocking

cmd/greenhouse/main.go Outdated Show resolved Hide resolved
cmd/greenhouse/main.go Outdated Show resolved Hide resolved
dev-env/localenv/README.md Outdated Show resolved Hide resolved
cmd/greenhouse/main.go Outdated Show resolved Hide resolved
@abhijith-darshan abhijith-darshan merged commit f0c7fec into main Aug 29, 2024
@abhijith-darshan abhijith-darshan deleted the feat/localenv branch August 29, 2024 13:23
andypf pushed a commit that referenced this pull request Sep 4, 2024
#452)

* (chore): init local env cli

* (chore): adds kind cluster creation

KinD cluster creation functionality. Additionally, can get a kind cluster, list kind clusters

* (chore): adds cluster command

cluster command to create kind cluster and optionally create a namespace after cluster creation

* (chore): common variables

* (chore): adds environment variables to disable webhooks and controllers

* (chore): adds cluster list and delete commands

* (chore): adds manifests command

manifests cmd explodes the specified chart by doing a helm template and applies it to the KinD cluster using kubectl apply

* (chore): adds webhook command

webhook command will deploy the operator to run in webhook only mode so that local development of controllers can be done without running webhooks. Validation and mutation of CR(s) will happen in-cluster

* (chore): adds setup command

setup command uses a config file to spin up a full development environment

* (chore): adds CLI markdown docs

auto-generates docs for cobra commands

* (chore): move commands to greenhousectl

in order to reduce complexity and encourage contributions by end users, dev CLI commands are moved from standalone to greenhousectl

* (chore): adds error handling and logging

* (fix): fixes typo

* Automatic application of license header

* (chore): adds review dog lint

* (fix): address lint issues

* (chore): use review dog linting

* (chore): update reviewdog lint version

* (chore): run lint as a separate job

* (chore): adds make setup dev

make command to build greenhousectl locally and setup the dev env

* (chore): adds dev setup configuration

* (chore): adds dev setup docs

* (chore): adds dev setup make commands

* (chore): reverts changes to unit-tests.yml

* (chore): tidy up!

* (chore): move to greenhousectl dev subcommands

* (chore): tidy up

* Automatic application of license header

* (chore): tidy up

* tidy up

* (chore): use method chains

* (chore): regenerate docs

* Automatic application of license header

* (fix): fix linting errors

* (chore): regenerate docs

* (revert): revert greenhousectl worklflow

* (chore): go fmt and tidy up!

* Automatic generation of CRD API Docs

* (chore): remove unused method

* Automatic generation of CRD API Docs

* (chore): re-run manifest generation

* Automatic generation of CRD API Docs

* (chore): refactor helm install

* Automatic generation of CRD API Docs

* Update dev-env/localenv/README.md

Co-authored-by: IvoGoman <ivo.gosemann@sap.com>

* Automatic generation of CRD API Docs

* Apply suggestions from code review

Co-authored-by: IvoGoman <ivo.gosemann@sap.com>

* (chore): provides back-off options

* (chore): removes unnecessary var assignment

* (chore): reuse existing build command

* (chore): provide helm client options as single slice

* (chore): generate dev setup markdown with templates

* (chore): allow one of webhook or controller modes or regular

* Automatic generation of CRD API Docs

* (chore): adds docker and kubectl check to persistent pre-run dev cmds

* (chore): tidy up

* Automatic generation of CRD API Docs

* (chore): go fmt

* (chore): go fmt

* Automatic generation of CRD API Docs

* (chore): upd variables

* Automatic generation of CRD API Docs

---------

Co-authored-by: License Bot <license_bot@github.com>
Co-authored-by: CRD API Docs Bot <crd_api_docs_bot@github.com>
Co-authored-by: IvoGoman <ivo.gosemann@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] - Local Development Environment with Kind
4 participants