{"id":13820357,"url":"https://github.com/cedi/kkpctl","last_synced_at":"2025-05-16T07:34:00.286Z","repository":{"id":43881709,"uuid":"344807762","full_name":"cedi/kkpctl","owner":"cedi","description":"a CLI tool for KKP","archived":true,"fork":false,"pushed_at":"2022-02-14T15:37:08.000Z","size":5409,"stargazers_count":5,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-15T01:30:46.097Z","etag":null,"topics":["cli","cluster","k8s","kkp","kubermatic","kubermatic-kubernetes-platform","kubernetes"],"latest_commit_sha":null,"homepage":"","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/cedi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-05T12:42:45.000Z","updated_at":"2023-01-28T03:05:41.000Z","dependencies_parsed_at":"2022-08-29T22:31:46.163Z","dependency_job_id":null,"html_url":"https://github.com/cedi/kkpctl","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedi%2Fkkpctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedi%2Fkkpctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedi%2Fkkpctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedi%2Fkkpctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedi","download_url":"https://codeload.github.com/cedi/kkpctl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254488810,"owners_count":22079501,"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":["cli","cluster","k8s","kkp","kubermatic","kubermatic-kubernetes-platform","kubernetes"],"created_at":"2024-08-04T08:01:01.993Z","updated_at":"2025-05-16T07:33:56.428Z","avatar_url":"https://github.com/cedi.png","language":"Go","funding_links":[],"categories":["kubernetes"],"sub_categories":[],"readme":"# Deprecation notice\n\nSince I do no longer work for a company uses [KKP](https://github.com/kubermatic/kubermatic) - nor do I personally run my own instance of KKP - I suspend all activity on this project.\nI do not have the resources (A KKP Platform to test against nor the time necessary) to maintain this project any longer.\n\nIf you consider using KKP and want to use it via CLI I highly recomment you fork this project.\n\nI won't provide any updates to this repository in the future!\n\n# kkpctl\n\n[![GitHub license](https://img.shields.io/github/license/cedi/kkpctl.svg)](https://github.com/cedi/kkpctl/blob/main/LICENSE)\n[![GitHub go.mod Go version of a Go module](https://img.shields.io/github/go-mod/go-version/cedi/kkpctl.svg)](https://github.com/cedi/kkpctl)\n[![GoDoc reference example](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/cedi/kkpctl)\n[![GoReportCard example](https://goreportcard.com/badge/github.com/cedi/kkpctl)](https://goreportcard.com/report/github.com/cedi/kkpctl)\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/cedi/kkpctl.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/cedi/kkpctl/alerts/)\n[![workflow status](https://github.com/cedi/kkpctl/actions/workflows/go.yml/badge.svg)](https://github.com/cedi/kkpctl/actions)\n\nThis tool aims to implement the [KKP](https://github.com/kubermatic/kubermatic) API as a useful CLI tool.\nThe usage should remind of kubectl.\n\n## Usage\n\nThe usage of `kkpctl` should remind of `kubectl`.\nFor the full usage documentation see the [docs](docs/).\n\n`kkpctl` comes with auto-completion right out of the box for bash, zsh, fish, and PowerShell.\n\n```bash\nkkpctl completion --help\n```\n\n## Quick-Start\n\n### Download `kkpctl` and install it to your `$GOPATH/bin` folder\n\n```bash\npushd /tmp\n\n# Get the Download URL for your system\nDOWNLOAD_PATH=$(curl -s https://api.github.com/repos/cedi/kkpctl/releases/latest | jq -r \".assets[]?.browser_download_url\" | grep --color=never --ignore-case $(uname -s) | grep --color=never $(uname -m | sed 's/x86_64/amd64/g'))\n\nFILENAME=$(echo $DOWNLOAD_PATH | awk -F'/' '{print $NF}')\nFOLDER_NAME=$(echo $FILENAME | sed 's/.tar.gz//g')\n\n# Download the tar.gz archive\ncurl -s -L $DOWNLOAD_PATH -o $FILENAME\n\n# unpack the tar.gz archive\nmkdir $FOLDER_NAME\ntar -xzf $FILENAME -C $FOLDER_NAME\n\n# install kkpctl to $GOPATH/bin/\ncp $FOLDER_NAME/kkpctl $GOPATH/bin/kkpctl\n\npopd\n```\n\n### Configure your KKP Cloud\n\n#### Service Account Token\n\nThe simplest way to access your KKP Cloud is trough Service Account Token.\nPlease see the [KKP Documentation](https://docs.kubermatic.com/kubermatic/v2.17/guides/service_account/using_service_account/) for how to retrieve a service account token.\n\nOnce you got your Token, you can configure `kkpctl` to use the service account token instead of OIDC authentication using\n\n```bash\nkkpctl config add cloud imke --url https://imke.cloud --auth_token akdfjhklqwerhli2uh=\n```\n\n#### OIDC\n\nRetrieve OIDC ClientID and Secret from your KKP installation\n\n\u003e __NOTE:__ Make sure, that `http://localhost:8000` is a valid RedirectURI in your dex configuration for the `kubermatic` client if you use this method.\n\u003e __Security Advise:__ It is better, if you register a separate OIDC Application for `kkpctl` that only allows redirect to `http://localhost:8080`. This is just meant a quick demo! Never do this in production!\n\n```bash\n# get the kubermatic client-secret\nCLIENT_SECRET=$(kubectl get configmap -n oauth dex -ojson | jq '.data.\"config.yaml\"' --raw-output | yq eval --tojson | jq '.staticClients | [ .[] | select( .id | contains(\"kubermatic\")) ] | .[].secret' --raw-output)\n\n# Add the kkp cloud with a name\nkkpctl config add cloud kubermatic_dev --url https://dev.kubermatic.io --client_id kubermatic --client_secret $CLIENT_SECRET\n\n# Set your context to use the freshly added cloud\nkkpctl ctx set cloud kubermatic_dev\n```\n\n### Login to kkp\n\n```bash\nkkpctl oidc-login\n```\n\nAnd you're done!\nNow, let's head over to the [working with kkpctl](docs/working-with-kkpctl.md) document where we go into more detail.\n\n## Contributing\n\n### devcontainer\n\nThe easiest way to get your development enviroment up and running is using the [devcontainer](https://code.visualstudio.com/docs/remote/containers-tutorial).\nSimply clone the repository, open the folder in your VSCode and accept the popup which asks if VSCode should restart in the dev-container.\n\n### Install from source\n\nPre-Requirement:\n\n* Having the `go` installed\n* your `$GOPATH` environment variable is set\n* `$GOPATH/bin` is part of your `$PATH` environment variable\n* Having `git` installed\n\n```bash\nmkdir -p $GOPATH/src/github.com/cedi/\ngit clone https://github.com/cedi/kkpctl.git $GOPATH/src/github.com/cedi/kkpctl\ncd $GOPATH/src/github.com/cedi/kkpctl\nmake install_release\n```\n\n### Makefile\n\nThe repository ships with a makefile which makes it easier to build and install the application.\nUseful Makefile targets are `build`, `release`, `test`, `test_all`, `install`, `install_release`, `clean`, and `vet`.\n\nMost of them are self-explaining. I just want to point out the difference between a \"development\" and a \"release\" build.\n\n* The development build is a regular `go build` with the `-race` flag enabled to detect race conditions easier.\n* The release build is a regular `go build` withouth the `-race` flag, but with `-ldflags \"-s -w\"` to strip the debug symbols from the binary.\n\nThe `build` and `release` targets depend on `fmt` and `tidy`, so your code is always formated and your `go.mod` file is always tidy.\n\n### Repository layout\n\n```bash\n├── .devcontainer   # the kkpctl repository comes with a devcontainer, so you can easily get started using VSCode\n├── .github         # all github related configuration lays here\n│   └── workflows   # contains the CI pipelines for kkpctl\n├── .vscode         # contains a launch.json to get started with debugging the code\n├── Makefile        # all the usefull aliases to build and test the project\n├── cmd             # everything related to command line parsing is located in here. This is where you probably wanna start looking at\n├── docs            # contains documentation\n├── hack            # contains scripts for development\n├── main.go         # the main entry point to the application\n├── pkg             # most of the code is located here\n│   ├── client      # the code that connects to the KKP API is here\n│   ├── config      # contains the logic around the configuration of kkpctl\n│   ├── describe    # the code that displays advanced information (describe) of a KKP API object\n│   ├── model       # some additional data models we defined\n│   ├── output      # similar as describe, but focuses on a simple output of an object\n│   └── utils       # some utility functions which are usefull :)\n└── tests           # contains mocks and test-files\n\n```\n\n## Pull requests\n\nI warmly welcome pull requests. Feel free to dig through the [issues](https://github.com/cedi/kkpctl/issues) and jump in with whatever you feel comfortable with.\nIf you have new feature ideas, feel free to open a new issue and we can have a discussion.\n\n[![made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](http://golang.org)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedi%2Fkkpctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedi%2Fkkpctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedi%2Fkkpctl/lists"}