• Stars
    star
    375
  • Rank 113,619 (Top 3 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

KinK is a helper CLI that facilitates to manage KinD clusters as Kubernetes pods. Designed to ease clusters up for fast testing with batteries included in mind.

kink Logo

kink

A helper CLI that facilitates to manage KinD clusters as Kubernetes pods.

Apache 2.0 Go Report Build Status GitHub release Go Mod Codecov


kink_v1.gif

Table of Contents

Introduction

Before getting started into the kink, we should talk about a bit KinD first who is not familiar with this project. KinD is a tool for running local Kubernetes clusters using Docker container _ nodes_. KinD was primarily designed for testing Kubernetes itself, but may be used for local development or CI.

So, what is kink then, where does this idea come from?

kink is a CLI application that facilitates to run KinD cluster in Kubernetes Pod and also manages the whole lifecycle of these clusters such as by listing them, deleting them, etc. There is a very detailed guide about how you can run KinD cluster in a Pod, for more detail, please see because this is where the idea came from.

The idea is that when you want to run ephemeral clusters by using projects like KinD in your CI/CD system instead of having Kubernetes clusters, because it might cost more, you might want to run your KinD cluster in a Pod, especially if you are using Gitlab as a CI/CD solution and running your jobs as Kubernetes Pod. This project specifically aims to solve that problem. By using kink, you can easily manage whole lifecycle of your KinD cluster no matter how many they are as Kubernetes Pod.

How it works ?

Architectural Diagram

kink_v1

kink is a just a wrapper around managing Docker images which are purposely built to run KinD on Kubernetes clusters inside a Pod. As I mentioned above, there is very detailed guide that explains all the necessary details to run Kind on Kubernetes clusters inside Pod. So, there are some Docker images which we maintained it here. In this repository, we are providing Docker images for different version of Docker and Kubernetes . Then, kink allows you to create Kubernetes Pods based on Docker images we provide and connect to the cluster running inside a Pod. In order the connect to the cluster running inside a Pod, kink does some tricks such as creating Kubernetes Service and adding node IP which is scheduled on to the CERT_SANS addresses to make the connection secure over HTTPS.

kink uses labels to follow the user activities because we have to provide multi-tenancy support for our users in order to avoid stepping each other toes in same Kubernetes environment, you can see the label which we are currently using to achieve uniqueness. https://github.com/Trendyol/kink/-/blob/master/cmd/run.go#L91

Installation

Go

If you have Go 1.16+, you can directly install by running:

$ go install github.com/Trendyol/kink@latest

and the resulting binary will be placed at $HOME/go/bin/kink.

Homebrew

If you have brew installed, then you can easily download this with the following commands:

brew tap trendyol/trendyol-tap
brew install kink

Quick Start

$ kink --help
A helper CLI that facilitates to manage KinD clusters as Kubernetes pods

Usage:
  kink [command]

Available Commands:
  completion              Generate completion script
  delete                  Ephemeral cluster could be deleted by delete command
  help                    Help about any command
  list                    List all ephemeral cluster
  list-supported-versions List all supported k8s versions
  run                     Ephemeral cluster could be created by run command

This shows how to:

  • list supported Kubernetes versions
  • pick one of these versions and run KinD cluster
  • list KinD clusters
  • delete KinD clusters

List supported Kubernetes versions

$ kink list-supported-versions
v1.16.15
v1.17.17
v1.19.11
v1.20.7
v1.21.2

Run KinD cluster

  • Choose one of your favorite Kubernetes distribution such as KinD, Minikube, k0s, k3s, etc and run it first.

Create custer with kind

$ kind create cluster

Run kink

$ kink run hello-world --timeout 360
[1/1] Creating Pod hello-world... 100% [===============] (0.001 kB/s)KUBECONFIG file has been written to
the directory: /var/folders/pf/6h9t0mnd4d342ncgpjq_3zl80000gp/T/kink_kubeconfig3638074110/kubeconfig
Thanks for using kink!
Pod hello-world and Service hello-world created successfully!

You can view the logs by running the following command:
$ kubectl logs -f hello-world -n default

KUBECONFIG file generated at path '/Users/batuhan.apaydin/workspace/projects/trendyol/k8s-common/kubeconfig'.
Start managing your internal KinD cluster by running the following command:
$ KUBECONFIG=/Users/batuhan.apaydin/workspace/projects/trendyol/k8s-common/kubeconfig kubectl get nodes -o wide

List KinD clusters

  • You can list all the KinD cluster provisied by yourself:
$ kink list
NAMESPACE   NAME              AGE    LABELS
default     pod/hello-world   5m5s   generated-uuid=99596236-4b08-4e09-82ec-db3158840a1c,runned-by=batuhan.apaydin_C02DM1U3MD6R

Delete KinD clusters

  • You can delete all the KinD clusters that you provisioned:
$ kink delete --all --force
Deleting Pod hello-world
Deleting Service hello-world
  • or you can delete one of them by speficying its name in the -name flag.

Autocompletion Support

To load completions:

Bash

$ source <(kink completion bash)

# To load completions for each session, execute once:
# Linux:
$ kink completion bash > /etc/bash_completion.d/kink
# macOS:
$ kink completion bash > /usr/local/etc/bash_completion.d/kink

Zsh

# If shell completion is not already enabled in your environment,
# you will need to enable it.  You can execute the following once:

$ echo "autoload -U compinit; compinit" >> ~/.zshrc

# To load completions for each session, execute once:
$ kink completion zsh > "${fpath[1]}/_kink"

# You will need to start a new shell for this setup to take effect.

fish

$ kink completion fish | source

# To load completions for each session, execute once:
$ kink completion fish > ~/.config/fish/completions/kink.fish

PowerShell

PS> kink completion powershell | Out-String | Invoke-Expression

# To load completions for every new session, run:
PS> kink completion powershell > kink.ps1
# and source this file from your PowerShell profile.

More Repositories

1

baklava

Baklava is a design system provided by Trendyol to create a consistent UI/UX for app users.
TypeScript
1,250
star
2

mobile-app-automizer

You can automize iOS and Android app's build, upload and versioning processes via Mobile App Automizer CLI tool.
JavaScript
576
star
3

medusa

Android fragment stack controller
Kotlin
483
star
4

docker-shell

A simple interactive prompt for docker
Go
391
star
5

android-guidelines

Architecture and code guidelines at Trendyol when developing for Android.
FreeMarker
388
star
6

react-carousel

Lightweight carousel component for react
TypeScript
293
star
7

gaos

HTTP mocking to test API services for chaos scenarios
Go
214
star
8

android-ui-components

Useful UI Components for Android Projects.
Kotlin
201
star
9

BubbleScrollBar

Kotlin
195
star
10

kediatR

Mediator implementation in Kotlin with native coroutine support
Kotlin
180
star
11

kafka-konsumer

Easy implementation of kafka consumer with built-in exception manager (kafka-cronsumer)
Go
147
star
12

stove

Stove: The easiest way of writing e2e tests for your JVM back-end API with Kotlin
Kotlin
146
star
13

mockingstar

Request mocking tool designed to simplify the process of http request mocking, network debugging, and UI tests for your applications.
Swift
144
star
14

four-key

four-key is a measurement tool written with golang for your repositories. This project inspired from Accelerate book.
Go
123
star
15

jest-testcontainers

Jest preset for running docker containers with your tests
TypeScript
122
star
16

ios-components

Swift
112
star
17

kubectl-view-webhook

๐Ÿ‘€ โ€ผ๏ธ This projects aims to visualize critical parts of the admission webhook configuration resource
Go
108
star
18

android-dev-tools

Android QA/Debug tools to speed up and streamline the development progress.
Kotlin
104
star
19

ios-guidelines

95
star
20

kubectl-easy-rollback

โ™ป๏ธ Now you can easily rollback to previous deployed images whatever you want on k8s environment
Go
93
star
21

Jdempotent

Make your consumer, API, etc. idempotent easily.
Java
89
star
22

baklava-react-native

TypeScript
89
star
23

quarkify

An awesome lightweight React UI Component library
TypeScript
83
star
24

perfanalytics

Web Performance Metrics
TypeScript
82
star
25

go-dcp

The Go implementation of the Couchbase DCP with various features
Go
81
star
26

go-dcp-elasticsearch

The Go implementation of the Couchbase to Elasticsearch with DCP.
Go
74
star
27

kafka-cronsumer

Cron based Kafka exception consumer with the power of auto retry & concurrency
Go
68
star
28

go-dcp-kafka

The Go implementation of the Couchbase to Kafka with DCP.
Go
67
star
29

ios-architecture-decision-logs

60
star
30

gurubu

Simple, Fast, and Practical Task Estimation and Tech Grooming. Live demo below ๐Ÿ‘‡
TypeScript
59
star
31

Transporter

Transporter is an open-source data transferring tool developed by Trendyol with love ๐Ÿงก
C#
50
star
32

code-playground

CodePlayground is a playground tool for go and rust language.
Go
47
star
33

mockingstar-ios

Mocking Star SPM helper library for iOS applications.
Swift
46
star
34

dom-event-tracker

Dynamically tracks mutations and listens for click and seen events
JavaScript
45
star
35

sidecache

Sidecar cache for kubernetes applications.
Go
42
star
36

boru

Boru is a pipeline solution
Kotlin
38
star
37

mockingstar-android

Mocking Star Kotlin helper library for Android applications.
Kotlin
38
star
38

go-dcp-couchbase

The Go implementation of the Couchbase to Couchbase with DCP.
Go
37
star
39

Loki

Loki provides an easy way to handle locking scenarios on distributed systems.
C#
35
star
40

kafka-shovel

Go
35
star
41

wolfichef

Secure image creator with wolfi packages.
Go
33
star
42

cbef

GitOps Capability Provider for Couchbase Eventing Functions ๐Ÿš€
Go
33
star
43

Trendyol.App

Application wrapper.
C#
30
star
44

k8s-webhook-certificator

๐Ÿ” ๐Ÿ—’๏ธ Creating K8S Secret which type is TLS that includes corresponding client certificates which are signed by K8S CA and private key
Go
30
star
45

supra

Circuit breaking http client for NodeJs. And it is fast...
JavaScript
29
star
46

MapsKit

Kotlin
28
star
47

overlog

Golang Logging with Mapped Diagnostic Context
Go
28
star
48

trendyol.github.io

This repository contains the source of the http://trendyol.github.io
HTML
26
star
49

nodejs-logger

Generic NodeJs Logger for storefront applications
TypeScript
25
star
50

pollgroo

TypeScript
25
star
51

swagger-parser-burp-extension

Python
25
star
52

kafka2rabbit

Kafka to rabbit go application
Go
24
star
53

teg

Teg is a library for managing feature toggles. It aims to allow to create and access to feature toggles in Golang easily and quickly!
Go
22
star
54

Osiris

Osiris, lord of the dead and rebirth
Kotlin
20
star
55

ios-tuist-remote-cache-example

๐Ÿ“ฆ๐Ÿ“ฑ Example of Vapor app built using the tuist remote cache feature.
Swift
19
star
56

AppSec

Java
19
star
57

kafka-wrapper

Go
19
star
58

smurfs

Easy way to build Micro-CLI Architecture for Developer Platform Teams
Go
18
star
59

trendyol-scheduler-service

Java
18
star
60

kafka-retry-job

Kafka Retry Job is an open-source project for moving Kafka messages from error topics to retry topics, developed by Trendyol with love ๐Ÿงก
C#
16
star
61

kubernetes-operator-api

The Kubernetes API is a sample Kubernetes operator API using the Java Kubernetes Client. The API is designed for master-worker deployment to satisfy the requirements.
Java
16
star
62

stately

Stately is a library for managing different states of a content in Jetpack Compose.
Kotlin
16
star
63

dynamic-render

๐Ÿ’ธ Optimizes SEO by dynamically rendering javascript powered websites
TypeScript
15
star
64

Confluent.Kafka

C#
14
star
65

safe-redirect

library which resolves open-redirection vulnerability when we need to make redirection to a path taken from query string.
TypeScript
14
star
66

kafkathena-jakarta

Java
14
star
67

react-intersection-images

React lazy load images with IntersectionObserver.
TypeScript
13
star
68

redis-slack-bot

Redis Slack Bot
Java
13
star
69

vault-plugin-database-yugabytedb

Go
12
star
70

network-status

Get network status of device
TypeScript
12
star
71

trendyol-consul-template-injector

๐Ÿณ This project is impletation of "Admission Webhook Controller" of k8s , made possible to inject consul-template image as a init and sidecar container.
Go
12
star
72

react-webcomponent-poc

Using Web Components API with React. A POC and a case study.
TypeScript
11
star
73

micro-trendyol

A Micro Trendyol designed by using Hexagonal Architecture + DDD + CQRS + SAGA
11
star
74

metrics

Export four key metrics of your repositories in CSV format
Go
11
star
75

otel-kafka-konsumer

open telemetry wrapper for kafka-go and kafka-konsumer
Go
11
star
76

kube-port-finder

kube-pf is a command line tool that find available ports on kubernetes
Go
11
star
77

debezium-with-smt

Java
10
star
78

consul-template-demo

Shell
10
star
79

codex

TypeScript
9
star
80

sonar-stryker-net-plugin

Java
9
star
81

dynamic-config-listener

Dynamic Config Listener
TypeScript
9
star
82

AutoFac.Extras.NLog.DotNetCore

Autofac Logging Module for NLog. Ported to .NET Standard 2.0 for .NET Core.
C#
8
star
83

go-future

Go routines with wait ability.
Go
8
star
84

verg

Semantic versioning CLI
Go
8
star
85

Commander-AS-Plugin

Kotlin
7
star
86

gomapper

An auto mapping tool for Golang DTOs
Go
6
star
87

CorrelationId

CorrelationId middleware for Dotnet projects
C#
6
star
88

ty-cookie-helper

simple cookie helper that provides functions to CRUD cookies
TypeScript
6
star
89

nodejs-fixture-repository

TypeScript
6
star
90

rate-limiting-with-ksql

Async Rate Limiting with ksqlDB
Java
6
star
91

openstack-swift-sdk

Openstack Swift SDK
TypeScript
6
star
92

kafkathena-commons

Smart, Fast, Customizable Consumer Configurations Common Utility Library
Java
6
star
93

apisix-plugins

Our downstream plugins (or modifications) for Apache APISIX.
Lua
5
star
94

infobip-client

Go
5
star
95

goncolos

Goncolos is simple wrapper top of confluent-kafka-dotnet
C#
4
star
96

express-validate-decorator

Validate expressjs request body and query.
TypeScript
4
star
97

ratelimit-operator

Istio rate limit operator
Go
4
star
98

wolfichef-fe

Wolfichef front-end project
Vue
4
star
99

jwt-generator

Java
4
star
100

mlflow-operator

Kubernetes Operator for MLflow
Go
4
star