Code Monkey home page Code Monkey logo

fubectl's Introduction

last stable release go report card godoc

Overview / User Guides

Kubermatic Kubernetes Platform is in an open source project to centrally manage the global automation of thousands of Kubernetes clusters across multicloud, on-prem and edge with unparalleled density and resilience.

All user documentation is available at the Kubermatic Kubernetes Platform docs website.

Editions

There are two editions of Kubermatic Kubernetes Platform:

Kubermatic Kubernetes Platform Community Edition (CE) is available freely under the Apache License, Version 2.0. Kubermatic Kubernetes Platform Enterprise Edition (EE) includes premium features that are most useful for organizations with large-scale Kubernetes installations with more than 50 clusters. To access the Enterprise Edition and get official support please become a subscriber.

Licensing

See the LICENSE file for licensing information as it pertains to files in this repository.

Installation

We strongly recommend that you use an official release of Kubermatic Kubernetes Platform. Follow the instructions under the Installation section of our documentation to get started.

The code and sample YAML files in the main branch of the kubermatic repository are under active development and are not guaranteed to be stable. Use them at your own risk!

More information

The documentation provides a getting started guide, plus information about building from source, architecture, extending kubermatic, and more.

Please use the version selector at the top of the site to ensure you are using the appropriate documentation for your version of kubermatic.

Troubleshooting

If you encounter issues file an issue or talk to us on the #kubermatic channel on the Kubermatic Community Slack (click here to join).

Contributing

Thanks for taking the time to join our community and start contributing!

Before you start

  • Please familiarize yourself with the Code of Conduct before contributing.
  • See CONTRIBUTING.md for instructions on the developer certificate of origin that we require.

Repository layout

├── addons    # Default Kubernetes addons
├── charts    # The Helm charts we use to deploy
├── cmd       # Various Kubermatic binaries for the controller-managers, operator etc.
├── codegen   # Helper programs to generate Go code and Helm charts
├── docs      # Some basic developer-oriented documentation
├── hack      # scripts for development and CI
└── pkg       # most of the actual codebase

Development environment

git clone [email protected]:kubermatic/kubermatic.git
cd kubermatic

There are a couple of scripts in the hacks directory to aid in running the components locally for testing purposes.

Running components locally

user-cluster-controller-manager

In order to instrument the seed-controller to allow for a local user-cluster-controller-manager, you need to add a worker-name label with your local machine's name as its value. Additionally, you need to scale down the already running deployment.

# Using a kubeconfig, which points to the seed-cluster
export cluster_id="<id-of-your-user-cluster>"
kubectl label cluster ${cluster_id} worker-name=$(uname -n)
kubectl scale deployment -n cluster-${cluster_id} usercluster-controller --replicas=0

Afterwards, you can start your local user-cluster-controller-manager.

# Using a kubeconfig, which points to the seed-cluster
./hack/run-user-cluster-controller-manager.sh
seed-controller-manager
./hack/run-seed-controller-manager.sh
master-controller-manager
./hack/run-master-controller-manager.sh

Run linters

Before every push, make sure you run:

make lint

Run tests

make test

Update code generation

The Kubernetes code-generator tool does not work outside of GOPATH (upstream issue), so the script below will automatically run the code generation in a Docker container.

hack/update-codegen.sh

Pull requests

  • We welcome pull requests. Feel free to dig through the issues and jump in.

Changelog

See the list of releases to find out about feature changes.

fubectl's People

Contributors

aborilov avatar az82 avatar dharapvj avatar erdii avatar eshepelyuk avatar kdomanski avatar krbcmt avatar kron4eg avatar lbb avatar luisdavim avatar metalmatze avatar osela avatar realfake avatar scheeles avatar thz avatar toschneck avatar ulrichschreiner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fubectl's Issues

default line number for klog -f

I would like to have default line number for klog -f so that I don't have to type in how many lines should be in the returned klog 200 -f

it would mirror the behaviour from tail and head as it says in the man page The default starting location is "-n 10", or the last 10 lines of the input

Watch a specific namespace

kwall is really not helpful when trying to monitor a specific namespace, because there's too much information being displayed at once.

The objective here would be to focus on a namespace.

It's an enhancement, is it viable?

kadd / kdel zsh

There seems to be parsing issues on zsh with kadd and kdel functions:

fubectl.source:69: defining function based on alias `ked'
fubectl.source:69: parse error near `()'

when commented out those functions all is fine

Missing documentation for many amazing commands

By grepping the source and comparing the README.md content.. I identified that below functions are not mentioned and documented in the README currently.

ka
kwa
kwatch
kcmd
kube_ctx_name
kube_ctx_namespace
kget
kexp
kget-exp
ked
kkonfig

Also we need to remove kdebug from the readme.md since it does not exist anymore in source.

pod name not recognised by kubectl

Hi there, thanks for the great tool.

I have used it for the past year and recently started using it again on a new computer.

Now, whenever I use klog or kfor, it fails with the following error message:

error: expected 'logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]'.
POD or TYPE/NAME is a required argument for the logs command
See 'kubectl logs -h' for help and examples

Any idea why this could be?

Separating the namespace and pod name solves the issue:
kiwiidb@282bc63

Vim issues with ked

Discovered the ked command introduced in fubectl but I currently cannot use it. Two (related) issues I have:

I run ked deploy and select one of my deployments to edit

kcs uses cluster name and not context name

hi,

when using kcs the code uses the name of the cluster as the context-name:

kcs() {
  context="$(kubectl config get-contexts | _inline_fzf | awk '{print $2}')"
  eval kubectl config set current-context "${context}"
}

$ kubectl config get-contexts
CURRENT   NAME           CLUSTER    AUTHINFO      NAMESPACE
          asterix-ns1    asterix    user1         ns1
*         obelix-ns1     obelix     user2         ns1
          obelix-ns2     obelix     user3         ns2
          minikube       minikube   minikube      

this only works, when the clustername and contextname are identical. if they are different, the configuration is corrupted. i think you should use print $1 for awk:

 context="$(kubectl config get-contexts | _inline_fzf | awk '{print $1}')"

kex not working as intented

kex sh error: expected 'exec POD_NAME COMMAND [ARG1] [ARG2] ... [ARGN]'. POD_NAME and COMMAND are required arguments for the exec command See 'kubectl exec -h' for help and examples.

kdes is not working

On Mac with zsh kdes is not working and giving below error. Which script mac user have to -- to -I or something like that ?

(⎈ |minikube:default)➜ hack git:(master) kdes po
xargs: illegal option -- r
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
[-L number] [-n number [-x]] [-P maxprocs] [-s size]
[utility [argument ...]]
(⎈ |minikube:default)➜ hack git:(master)

ksearch error: unknown flag: --export

ksearch <smth>
error: unknown flag: --export
See 'kubectl get --help' for usage.

kubectl version --client
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:25:17Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}

Inclusion of stern/kail for multi pod logs?

Can we make use of stern / kail to monitor multiple logs at the same time?

We might need to build a thin wrapper to ask questions to user about how they want to tail logs - deployment or service or label etc... then logs can appear.

zsh : kex bash command promote not valid in this context

zsh version 5.0.2
kex klog func not working

local command in zsh not identify string include space
for example: local val=$(echo "hello world"|awk '{print $1, $2}')
val equal to hello not hello world
i resolve it by double quote like this: "$(echo "hello world"|awk '{print $1, $2}') "

Installation on macOS Catalina with oh-my-zsh

All prerequsite installed but during the installation I see the following output:

[ -f /Users/1/apps/fubectl/fubectl.source ] && source /Users/1/apps/fubectl/fubectl.source
/Users/1/apps/fubectl/fubectl.source:90: defining function based on alias `ked'
/Users/1/apps/fubectl/fubectl.source:90: parse error near `()'

First release? Tag?

Could you create a first release or tag? I am looking into packaging this for openSUSE, so having tags/releases would be nice...

Consider separate aliases for current NS and all NS

Hello

Currently many aliases are querying resources from all namespaces. In case of big cluster with dozens NS and dozens of pods in evey NS such frequent querying could affect cluster performance and also provide slow response time to end users.

I propose to introduce one of the following

  • config parameter (env var, file) that changes namespace filtering behaviour of all declared aliases
  • duplicate aliases to have 2 commands
    • klog for current namespace
    • kloga for all namespaces
    • For backward compatibility it could be klog for current behaviour (all NS) and klg for current NS

Wdyt ?

One improvement to kube_ctx_namespace

Hi all!

Looking for new ideas I found your project. It gave me some ones and I'd like to share my visions with you. Hope it will help you further.

fubectl/fubectl.source

Lines 80 to 85 in 3950b1e

# [kube_ctx_namespace] get current namespace
function kube_ctx_namespace() {
local default_ns="$(kubectl config view --minify|grep namespace: |sed 's/namespace: //g'|tr -d ' ')"
default_ns="${default_ns:-default}"
echo "$default_ns"
}

I think the snippet above can be improved a little bit in the way as below. It requires kubectl itself and its jsonpath features that have already been embedded.

kubectl config view --minify \
-o jsonpath="{range .contexts[*].context}{@.user}{\"@\"}{@.cluster}{\":\"}{@.namespace}{\"\n\"}"

It displays the current context in the form similar to the unix prompt like user@cluster:namespace. It's constructed to be used directly or as an alias. You can take it as is or modify on your wants or drop as a bad idea for your project :).

[proposal] adopt kubectx/kubens

Hello,

To manage context and namespace switching functionality - kubectx/kubens toolset could be used.
They could be installed via krew as other plugins used by fubectl.
fubectl could provide useful aliases like kctx / kns, current context / namespace functions would be deprecated.

Tools homepage: https://github.com/ahmetb/kubectx

Some commands from README seem to be outdated

For example, kdebug is described in the project's README, however I can't see any mentions of this function in the current fubectl.source. (I haven't made a PR for this as I am not sure whether kdebug should actually exist for fubectl.)

At the same time, quite interesting commands including ked, ksec, and konsole are defined in the source file, however they are missing in the README.

implement kinstall for dependencies

To prevent errors with dependencies like e.g.

# [ktree] prints a tree of k8s objects (kubectl tree plugin needs to be installed)

we should implement:

  • check if the dependencies are there
  • kinstall command what installs the needed dependencies

Regex parse Error

Hi,

I've done a fresh setup of fubectl. Everything is working fine, but when I do almost any command I get an regex parse error.

image

I suppose its a problem with my setup, but I don't know there exactly the error is coming from.

Any Ideas?

Thanks in advance for any help :)

MicroK8s support

MicroK8S is Kubernetes Distribution from Canonical packaged as snap

Since MicroK8s uses proxy command (microk8s.kubectl get pods instead of kubectl get pods) this would require extracting kubectl command to own variable and maybe some logic like if kubectl bin isn't in $PATH then try microk8s.kubectl

I'm willing to submit pull request if this is found useful

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.