Compare commits

...

35 Commits

Author SHA1 Message Date
enrichman
79ce98e164 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2026-04-24 17:01:29 +00:00
enrichman
4dc83be045 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2026-04-15 14:38:41 +00:00
enrichman
772dd15ee3 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2026-04-09 15:42:07 +00:00
enrichman
975d5f9cc2 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2026-03-24 08:54:02 +00:00
bigkevmcd
b08c351652 Update index.yaml
Signed-off-by: bigkevmcd <bigkevmcd@users.noreply.github.com>
2026-02-16 14:56:30 +00:00
enrichman
ee60651602 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2026-01-29 08:56:00 +00:00
enrichman
a96c67522c Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2026-01-15 13:14:48 +00:00
enrichman
2d2c750769 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-12-09 14:41:59 +00:00
enrichman
3a7d418576 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-12-03 14:02:05 +00:00
enrichman
a53827fa32 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-11-17 17:25:25 +00:00
enrichman
fc9710a83f Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-11-03 15:44:38 +00:00
enrichman
a5dddac72e Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-10-31 16:01:53 +00:00
enrichman
06b53d35a9 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-10-28 15:30:42 +00:00
enrichman
2ced39df3e Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-10-14 13:19:34 +00:00
galal-hussein
ee458cff4d Update index.yaml
Signed-off-by: galal-hussein <galal-hussein@users.noreply.github.com>
2025-09-30 12:27:29 +00:00
galal-hussein
1a56483285 Update index.yaml
Signed-off-by: galal-hussein <galal-hussein@users.noreply.github.com>
2025-09-17 09:16:58 +00:00
enrichman
d98735583d Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-08-28 08:57:50 +00:00
enrichman
14ba636ee0 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-08-25 17:03:08 +00:00
enrichman
851b19aade Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-08-19 08:57:52 +00:00
enrichman
8527b444c5 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-07-24 15:13:44 +00:00
enrichman
c75e07f1c0 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-06-30 08:45:00 +00:00
galal-hussein
f34ba97c72 Update index.yaml
Signed-off-by: galal-hussein <galal-hussein@users.noreply.github.com>
2025-06-27 14:06:59 +00:00
enrichman
545b6d6daf Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-06-25 08:51:00 +00:00
galal-hussein
84791613bc Update index.yaml
Signed-off-by: galal-hussein <galal-hussein@users.noreply.github.com>
2025-06-24 13:00:57 +00:00
enrichman
094af525b2 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-06-20 16:20:26 +00:00
enrichman
0d3122ed54 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-06-04 07:57:47 +00:00
enrichman
b15bfdc83c Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-04-18 10:45:23 +00:00
galal-hussein
cd5fe2d52e Update index.yaml
Signed-off-by: galal-hussein <galal-hussein@users.noreply.github.com>
2025-03-21 01:30:36 +00:00
enrichman
1be8407c94 Update index.yaml
Signed-off-by: enrichman <enrichman@users.noreply.github.com>
2025-03-03 16:15:27 +00:00
galal-hussein
66ac302f4b Update index.yaml
Signed-off-by: galal-hussein <galal-hussein@users.noreply.github.com>
2025-02-17 13:13:16 +00:00
galal-hussein
ab3f916d0b Update index.yaml
Signed-off-by: galal-hussein <galal-hussein@users.noreply.github.com>
2025-02-14 13:36:51 +00:00
galal-hussein
f78af9a0db add chart-chart-0.1.5-r1 to index.yaml 2025-01-23 19:04:26 +00:00
Hussein Galal
8b0383f35e Fix chart release action (#210)
* Fix chart release action

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

* Fix chart release action

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>

---------

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-01-23 21:02:34 +02:00
Enrico Candino
9e52c375a0 bump urfave/cli to v2 (#205) 2025-01-23 10:14:01 +01:00
Hussein Galal
ca8f30fd9e upgrade chart (#207)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
2025-01-23 02:30:12 +02:00
13 changed files with 486 additions and 102 deletions

View File

@@ -4,7 +4,7 @@ on:
- "chart-*"
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
name: Chart
permissions:
@@ -28,4 +28,3 @@ jobs:
- name: Index Chart
run: |
make index-chart

View File

@@ -2,5 +2,5 @@ apiVersion: v2
name: k3k
description: A Helm chart for K3K
type: application
version: 0.1.5-r5
appVersion: v0.2.2-rc2
version: 0.1.5-r1
appVersion: v0.2.2-rc4

View File

@@ -2,30 +2,26 @@ package cluster
import (
"github.com/rancher/k3k/cli/cmds"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
var subcommands = []cli.Command{
var subcommands = []*cli.Command{
{
Name: "create",
Usage: "Create new cluster",
SkipFlagParsing: false,
SkipArgReorder: true,
Action: create,
Flags: append(cmds.CommonFlags, clusterCreateFlags...),
Name: "create",
Usage: "Create new cluster",
Action: create,
Flags: append(cmds.CommonFlags, clusterCreateFlags...),
},
{
Name: "delete",
Usage: "Delete an existing cluster",
SkipFlagParsing: false,
SkipArgReorder: true,
Action: delete,
Flags: append(cmds.CommonFlags, clusterDeleteFlags...),
Name: "delete",
Usage: "Delete an existing cluster",
Action: delete,
Flags: append(cmds.CommonFlags, clusterDeleteFlags...),
},
}
func NewCommand() cli.Command {
return cli.Command{
func NewCommand() *cli.Command {
return &cli.Command{
Name: "cluster",
Usage: "cluster command",
Subcommands: subcommands,

View File

@@ -16,7 +16,7 @@ import (
"github.com/rancher/k3k/pkg/controller/cluster/server"
"github.com/rancher/k3k/pkg/controller/kubeconfig"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -51,65 +51,65 @@ var (
mode string
clusterCreateFlags = []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: "name",
Usage: "name of the cluster",
Destination: &name,
},
cli.Int64Flag{
&cli.Int64Flag{
Name: "servers",
Usage: "number of servers",
Destination: &servers,
Value: 1,
},
cli.Int64Flag{
&cli.Int64Flag{
Name: "agents",
Usage: "number of agents",
Destination: &agents,
},
cli.StringFlag{
&cli.StringFlag{
Name: "token",
Usage: "token of the cluster",
Destination: &token,
},
cli.StringFlag{
&cli.StringFlag{
Name: "cluster-cidr",
Usage: "cluster CIDR",
Destination: &clusterCIDR,
},
cli.StringFlag{
&cli.StringFlag{
Name: "service-cidr",
Usage: "service CIDR",
Destination: &serviceCIDR,
},
cli.StringFlag{
&cli.StringFlag{
Name: "persistence-type",
Usage: "Persistence mode for the nodes (ephermal, static, dynamic)",
Value: server.EphermalNodesType,
Destination: &persistenceType,
},
cli.StringFlag{
&cli.StringFlag{
Name: "storage-class-name",
Usage: "Storage class name for dynamic persistence type",
Destination: &storageClassName,
},
cli.StringSliceFlag{
&cli.StringSliceFlag{
Name: "server-args",
Usage: "servers extra arguments",
Value: &serverArgs,
},
cli.StringSliceFlag{
&cli.StringSliceFlag{
Name: "agent-args",
Usage: "agents extra arguments",
Value: &agentArgs,
},
cli.StringFlag{
&cli.StringFlag{
Name: "version",
Usage: "k3s version",
Destination: &version,
Value: "v1.26.1-k3s1",
},
cli.StringFlag{
&cli.StringFlag{
Name: "mode",
Usage: "k3k mode type",
Destination: &mode,
@@ -153,8 +153,8 @@ func create(clx *cli.Context) error {
int32(agents),
clusterCIDR,
serviceCIDR,
serverArgs,
agentArgs,
serverArgs.Value(),
agentArgs.Value(),
)
cluster.Spec.Expose = &v1alpha1.ExposeConfig{

View File

@@ -6,7 +6,7 @@ import (
"github.com/rancher/k3k/cli/cmds"
"github.com/rancher/k3k/pkg/apis/k3k.io/v1alpha1"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/clientcmd"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -14,7 +14,7 @@ import (
var (
clusterDeleteFlags = []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: "name",
Usage: "name of the cluster",
Destination: &name,

View File

@@ -14,7 +14,7 @@ import (
"github.com/rancher/k3k/pkg/controller/certs"
"github.com/rancher/k3k/pkg/controller/kubeconfig"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
@@ -39,33 +39,33 @@ var (
expirationDays int64
configName string
generateKubeconfigFlags = []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: "name",
Usage: "cluster name",
Destination: &name,
},
cli.StringFlag{
&cli.StringFlag{
Name: "config-name",
Usage: "the name of the generated kubeconfig file",
Destination: &configName,
},
cli.StringFlag{
&cli.StringFlag{
Name: "cn",
Usage: "Common name (CN) of the generated certificates for the kubeconfig",
Destination: &cn,
Value: controller.AdminCommonName,
},
cli.StringSliceFlag{
&cli.StringSliceFlag{
Name: "org",
Usage: "Organization name (ORG) of the generated certificates for the kubeconfig",
Value: &org,
},
cli.StringSliceFlag{
&cli.StringSliceFlag{
Name: "altNames",
Usage: "altNames of the generated certificates for the kubeconfig",
Value: &altNames,
},
cli.Int64Flag{
&cli.Int64Flag{
Name: "expiration-days",
Usage: "Expiration date of the certificates used for the kubeconfig",
Destination: &expirationDays,
@@ -74,19 +74,18 @@ var (
}
)
var subcommands = []cli.Command{
var subcommands = []*cli.Command{
{
Name: "generate",
Usage: "Generate kubeconfig for clusters",
SkipFlagParsing: false,
SkipArgReorder: true,
Action: generate,
Flags: append(cmds.CommonFlags, generateKubeconfigFlags...),
},
}
func NewCommand() cli.Command {
return cli.Command{
func NewCommand() *cli.Command {
return &cli.Command{
Name: "kubeconfig",
Usage: "Manage kubeconfig for clusters",
Subcommands: subcommands,
@@ -123,13 +122,15 @@ func generate(clx *cli.Context) error {
}
host := strings.Split(url.Host, ":")
certAltNames := certs.AddSANs(altNames)
if org == nil {
org = cli.StringSlice{user.SystemPrivilegedGroup}
certAltNames := certs.AddSANs(altNames.Value())
orgs := org.Value()
if orgs == nil {
orgs = []string{user.SystemPrivilegedGroup}
}
cfg := kubeconfig.KubeConfig{
CN: cn,
ORG: org,
ORG: orgs,
ExpiryDate: time.Hour * 24 * time.Duration(expirationDays),
AltNames: certAltNames,
}

View File

@@ -2,7 +2,7 @@ package cmds
import (
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
const (
@@ -14,13 +14,13 @@ var (
Kubeconfig string
namespace string
CommonFlags = []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: "kubeconfig",
EnvVar: "KUBECONFIG",
EnvVars: []string{"KUBECONFIG"},
Usage: "Kubeconfig path",
Destination: &Kubeconfig,
},
cli.StringFlag{
&cli.StringFlag{
Name: "namespace",
Usage: "Namespace to create the k3k cluster in",
Destination: &namespace,
@@ -33,11 +33,11 @@ func NewApp() *cli.App {
app.Name = "k3kcli"
app.Usage = "CLI for K3K"
app.Flags = []cli.Flag{
cli.BoolFlag{
&cli.BoolFlag{
Name: "debug",
Usage: "Turn on debug logs",
Destination: &debug,
EnvVar: "K3K_DEBUG",
EnvVars: []string{"K3K_DEBUG"},
},
}

View File

@@ -9,7 +9,7 @@ import (
"github.com/rancher/k3k/cli/cmds/kubeconfig"
"github.com/rancher/k3k/pkg/buildinfo"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func main() {
@@ -19,7 +19,7 @@ func main() {
fmt.Println("k3kcli Version: " + buildinfo.Version)
}
app.Commands = []cli.Command{
app.Commands = []*cli.Command{
cluster.NewCommand(),
kubeconfig.NewCommand(),
}

5
go.mod
View File

@@ -19,7 +19,7 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/testcontainers/testcontainers-go v0.35.0
github.com/testcontainers/testcontainers-go/modules/k3s v0.35.0
github.com/urfave/cli v1.22.12
github.com/urfave/cli/v2 v2.27.5
github.com/virtual-kubelet/virtual-kubelet v1.11.0
go.etcd.io/etcd/api/v3 v3.5.14
go.etcd.io/etcd/client/v3 v3.5.14
@@ -61,7 +61,7 @@ require (
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cpuguy83/dockercfg v0.3.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
@@ -168,6 +168,7 @@ require (
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect
go.opencensus.io v0.24.0 // indirect

11
go.sum
View File

@@ -606,7 +606,6 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
@@ -712,9 +711,9 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA=
github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
@@ -1209,8 +1208,8 @@ github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+F
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8=
github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8=
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
github.com/virtual-kubelet/virtual-kubelet v1.11.0 h1:LOMcZQfP083xmYH9mYtyHAR+ybFbK1uMaRA+EtDcd1I=
github.com/virtual-kubelet/virtual-kubelet v1.11.0/go.mod h1:WQfPHbIlzfhMNYkh6hFXF1ctGfNM8UJCYLYpLa/trxc=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
@@ -1225,6 +1224,8 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

384
index.yaml Normal file
View File

@@ -0,0 +1,384 @@
apiVersion: v1
entries:
k3k:
- apiVersion: v2
appVersion: v1.1.0-rc4
created: "2026-04-15T14:38:41.242283396Z"
description: A Helm chart for K3K
digest: 5814c25d724fbcb8a667f2ca4af411925ec8d42a6c02ad75aabcebfe78c544f5
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.1.0-rc4/k3k-1.1.0-rc4.tgz
version: 1.1.0-rc4
- apiVersion: v2
appVersion: v1.1.0-rc3
created: "2026-04-09T15:42:07.085777565Z"
description: A Helm chart for K3K
digest: b917f83d74bedf8b8b4a76f76ed73b0ee4757bd695178a6a0091099b6ba813f3
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.1.0-rc3/k3k-1.1.0-rc3.tgz
version: 1.1.0-rc3
- apiVersion: v2
appVersion: v1.1.0-rc2
created: "2026-03-24T08:54:02.646648438Z"
description: A Helm chart for K3K
digest: be0419085409a7c199adf10db64cfa75e61af5f17fbc1d99596421343461f0bf
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.1.0-rc2/k3k-1.1.0-rc2.tgz
version: 1.1.0-rc2
- apiVersion: v2
appVersion: v1.0.3-rc1
created: "2026-04-24T17:01:29.509418768Z"
description: A Helm chart for K3K
digest: ab0755e4103d844ee4098955bd8311ade9efdca4a1dc02ac5e98f12c9a869bc8
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.3-rc1/k3k-1.0.3-rc1.tgz
version: 1.0.3-rc1
- apiVersion: v2
appVersion: v1.0.2
created: "2026-02-16T14:56:30.465967547Z"
description: A Helm chart for K3K
digest: 2b8431e0f8d0369e9aafb2d93f7f02f60fc39fdb8a1bcdffada70cff2e088c35
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.2/k3k-1.0.2.tgz
version: 1.0.2
- apiVersion: v2
appVersion: v1.0.2-rc2
created: "2026-01-29T08:56:00.013920706Z"
description: A Helm chart for K3K
digest: 22fe9e44b4d3e2c61d2343f450949f87056b069faabf3dc8eddef49a6319c4ff
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.2-rc2/k3k-1.0.2-rc2.tgz
version: 1.0.2-rc2
- apiVersion: v2
appVersion: v1.0.2-rc1
created: "2026-01-15T13:14:48.456179859Z"
description: A Helm chart for K3K
digest: d8876d2a3de38d0e2e274034a71746ddfa40f5fef2a395d84e1e8396339bd725
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.2-rc1/k3k-1.0.2-rc1.tgz
version: 1.0.2-rc1
- apiVersion: v2
appVersion: v1.0.1
created: "2025-12-09T14:41:59.654224073Z"
description: A Helm chart for K3K
digest: 47d5318a4e9d60192fe6950ad111f7820cbcc39c79a85ceacd9f0c25dc5366a4
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.1/k3k-1.0.1.tgz
version: 1.0.1
- apiVersion: v2
appVersion: v1.0.1-rc2
created: "2025-12-03T14:02:05.472877082Z"
description: A Helm chart for K3K
digest: 2a7d5d915b5a0bc0f1db62bb2fb922daa0e5b61585b1856dfe64ea1527ad214e
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.1-rc2/k3k-1.0.1-rc2.tgz
version: 1.0.1-rc2
- apiVersion: v2
appVersion: v1.0.1-rc1
created: "2025-11-17T17:25:25.106204732Z"
description: A Helm chart for K3K
digest: 4b3dde184a01c4555a52af1b7a6d78ef9402e00b7630dc2d7ff6d1cc5d4dc163
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.1-rc1/k3k-1.0.1-rc1.tgz
version: 1.0.1-rc1
- apiVersion: v2
appVersion: v1.0.0
created: "2025-11-03T15:44:38.393518232Z"
description: A Helm chart for K3K
digest: 173d90bfe6d2b60af590c29090c4c32290edcbe0998c048f6d59a36460ac3e0b
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.0/k3k-1.0.0.tgz
version: 1.0.0
- apiVersion: v2
appVersion: v1.0.0-rc3
created: "2025-10-31T16:01:53.317011317Z"
description: A Helm chart for K3K
digest: 88c034e940e4714d073e16a9686c81de873cb9358146bb83079298bbf3c12216
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.0-rc3/k3k-1.0.0-rc3.tgz
version: 1.0.0-rc3
- apiVersion: v2
appVersion: v1.0.0-rc2
created: "2025-10-28T15:30:42.120914789Z"
description: A Helm chart for K3K
digest: 2383239f7dd671361ac63b41258d37dafc602d4ab0150699eb777d6706b483b3
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.0-rc2/k3k-1.0.0-rc2.tgz
version: 1.0.0-rc2
- apiVersion: v2
appVersion: v1.0.0-rc1
created: "2025-10-14T13:19:34.016218173Z"
description: A Helm chart for K3K
digest: 4facfe1cc00be65a79a885c4a2d3be4e62646c4df9fd35691f0851db8563ddb5
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-1.0.0-rc1/k3k-1.0.0-rc1.tgz
version: 1.0.0-rc1
- apiVersion: v2
appVersion: v0.3.5
created: "2025-09-30T12:27:28.916176598Z"
description: A Helm chart for K3K
digest: 01c7f514530504980f8ee28092d3d584ddb6beebf730e125a2a371126261b6ad
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.5/k3k-0.3.5.tgz
version: 0.3.5
- apiVersion: v2
appVersion: v0.3.5-rc1
created: "2025-09-17T09:16:58.061714814Z"
description: A Helm chart for K3K
digest: 672a6f9cb7d9c9a600d2e8c6f022221c7db061f13ec173ade36196fd87152aa8
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.5-rc1/k3k-0.3.5-rc1.tgz
version: 0.3.5-rc1
- apiVersion: v2
appVersion: v0.3.4
created: "2025-08-28T08:57:50.805906218Z"
description: A Helm chart for K3K
digest: bfac6ec18a5a25dfe1d1ad35b4c09be6e3c8c7739c5230655c1eba3f9f39585d
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.4/k3k-0.3.4.tgz
version: 0.3.4
- apiVersion: v2
appVersion: v0.3.4-rc3
created: "2025-08-25T17:03:08.195077205Z"
description: A Helm chart for K3K
digest: c7e8ba5c75c5c94dcf05f5667e9aca7dbfde1df68c72dd5139c15889f49a4dd3
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.4-rc3/k3k-0.3.4-rc3.tgz
version: 0.3.4-rc3
- apiVersion: v2
appVersion: v0.3.4-rc2
created: "2025-08-19T08:57:52.214719255Z"
description: A Helm chart for K3K
digest: e177c8e12a17d0c22084b42ea0b05983799501bb852192b41f3f3a357ff6542b
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.4-rc2/k3k-0.3.4-rc2.tgz
version: 0.3.4-rc2
- apiVersion: v2
appVersion: v0.3.4-rc1
created: "2025-07-24T15:13:44.735105812Z"
description: A Helm chart for K3K
digest: 8bf37262fb23265ab0afb2e1cfae17f80f211b3536f226bb43fc638586d65737
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.4-rc1/k3k-0.3.4-rc1.tgz
version: 0.3.4-rc1
- apiVersion: v2
appVersion: v0.3.3
created: "2025-06-30T08:44:59.953223554Z"
description: A Helm chart for K3K
digest: 679b917d6cffe7f649c3e11b8577e477376359bcaee08cf4160beb69de6cd03c
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.3/k3k-0.3.3.tgz
version: 0.3.3
- apiVersion: v2
appVersion: v0.3.3-rc6
created: "2025-06-27T14:06:59.461066242Z"
description: A Helm chart for K3K
digest: d9c4163660f7814d98e468b4077ba98822c218a71c083c9b1c0742a1b0d63503
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.3-r6/k3k-0.3.3-r6.tgz
version: 0.3.3-r6
- apiVersion: v2
appVersion: v0.3.3-rc5
created: "2025-06-25T08:51:00.220876148Z"
description: A Helm chart for K3K
digest: e2fb4b93ada759ec3b50c3f381de7bd17bd74aa48c64fe94310607662218ea88
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.3-r5/k3k-0.3.3-r5.tgz
version: 0.3.3-r5
- apiVersion: v2
appVersion: v0.3.3-rc4
created: "2025-06-24T13:00:57.51443719Z"
description: A Helm chart for K3K
digest: a8f04ed83fb34c9e9daa7828a496d9260ff1686e2d0008735e0aabc158dff2b2
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.3-r4/k3k-0.3.3-r4.tgz
version: 0.3.3-r4
- apiVersion: v2
appVersion: v0.3.3-rc3
created: "2025-06-20T16:20:26.393275671Z"
description: A Helm chart for K3K
digest: 0528181d151b13762b98f2dfd45d6357c034f7b89380944e2a177d8e62feaa10
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.3-r3/k3k-0.3.3-r3.tgz
version: 0.3.3-r3
- apiVersion: v2
appVersion: v0.3.3-rc1
created: "2025-06-04T07:57:47.069248739Z"
description: A Helm chart for K3K
digest: 80643b92f3b35b9f71096e9231c73185086516831c80f498c5dda2e130ff9614
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.3-r1/k3k-0.3.3-r1.tgz
version: 0.3.3-r1
- apiVersion: v2
appVersion: v0.3.2
created: "2025-04-18T10:45:23.246160851Z"
description: A Helm chart for K3K
digest: 505d190ef24da6265ad2aaf3e262ba9b7c0709407caa3cca9d2844016976bf77
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.2/k3k-0.3.2.tgz
version: 0.3.2
- apiVersion: v2
appVersion: v0.3.1
created: "2025-03-21T01:30:36.632888085Z"
description: A Helm chart for K3K
digest: a610031362ff92f0b354bf5ae73ef58773a604c9e3864a36dbd491211c3d43b8
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.1-r2/k3k-0.3.1-r2.tgz
version: 0.3.1-r2
- apiVersion: v2
appVersion: v0.3.1-rc1
created: "2025-03-03T16:15:27.474796611Z"
description: A Helm chart for K3K
digest: 68ea6319dfecdcaa0da0fe17fb1dee6ee7919a31489d1ab0c31894c9ffa75bf4
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.1-r1/k3k-0.3.1-r1.tgz
version: 0.3.1-r1
- apiVersion: v2
appVersion: v0.3.0
created: "2025-02-17T13:13:16.005242178Z"
description: A Helm chart for K3K
digest: e543450b8960dc559823327381c0aef3d291785297367246c08607083ff08a77
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.3.0-r1/k3k-0.3.0-r1.tgz
version: 0.3.0-r1
- apiVersion: v2
appVersion: v0.2.2-rc5
created: "2025-02-14T13:36:51.20921457Z"
description: A Helm chart for K3K
digest: 4cfa0028c8e73c7cb6a02168c6547e49e1f895f51a7eb51e2b9dd60754798c68
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.1.6-r1/k3k-0.1.6-r1.tgz
version: 0.1.6-r1
- apiVersion: v2
appVersion: v0.2.2-rc4
created: "2025-01-23T19:04:26.116807778Z"
description: A Helm chart for K3K
digest: ac4b667ec3e9f7d7f1cc9500bc2b66659e642774eb74a459afca9771dcdcaf43
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.1.5-r1/k3k-0.1.5-r1.tgz
version: 0.1.5-r1
- apiVersion: v2
appVersion: 0.2.0
created: "2024-03-15T00:14:20.084301115Z"
description: A Helm chart for K3K
digest: 3e84624544426312d541cd9157075ce9eaa48a3fcbd51cb616696a33098f6cab
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.1.4-r1/k3k-0.1.4-r1.tgz
version: 0.1.4-r1
- apiVersion: v2
appVersion: 0.2.0
created: "2024-02-15T22:04:54.039214701Z"
description: A Helm chart for K3K
digest: 750470714dbe548ec72fb4b297f02fb14acc7debc1df681a71a57f3dc639ac74
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.1.3-r1/k3k-0.1.3-r1.tgz
version: 0.1.3-r1
- apiVersion: v2
appVersion: 0.1.1
created: "2024-01-06T05:45:05.385260037Z"
description: A Helm chart for K3K
digest: 387721f339d1ce28e77a77c2c56e4598ea8b8e9828cb52dd014313f45efac0d0
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.1.2-r1/k3k-0.1.2-r1.tgz
version: 0.1.2-r1
- apiVersion: v2
appVersion: 0.1.0
created: "2024-01-03T00:59:14.9735535Z"
description: A Helm chart for K3K
digest: 57b5d181809031e781bcea2deb32f8169c64fb52f312d2c2e34039b00700fbff
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.1.1-r1/k3k-0.1.1-r1.tgz
version: 0.1.1-r1
- apiVersion: v2
appVersion: 0.0.0-alpha7
created: "2023-07-03T21:37:09.595779207Z"
description: A Helm chart for K3K
digest: 06a53a68ce620e9bf736d02aba7e7db58c3e85795e99c9eb006997cd2f7889bb
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.1.0-r2/k3k-0.1.0-r2.tgz
version: 0.1.0-r2
- apiVersion: v2
appVersion: 0.0.0-alpha6
created: "2023-06-23T21:52:08.959064023Z"
description: A Helm chart for K3K
digest: 5e480db568f34f3be4686f93e0134a3fcbb0a6f9a566c02c745456102c35d880
name: k3k
type: application
urls:
- https://github.com/rancher/k3k/releases/download/chart-0.1.0-r1/k3k-0.1.0-r1.tgz
version: 0.1.0-r1
generated: "2026-04-24T17:01:29.509798021Z"

View File

@@ -7,7 +7,7 @@ import (
"github.com/go-logr/zapr"
"github.com/rancher/k3k/pkg/log"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"go.uber.org/zap"
ctrlruntimelog "sigs.k8s.io/controller-runtime/pkg/log"
)
@@ -24,73 +24,73 @@ func main() {
app.Name = "k3k-kubelet"
app.Usage = "virtual kubelet implementation k3k"
app.Flags = []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: "cluster-name",
Usage: "Name of the k3k cluster",
Destination: &cfg.ClusterName,
EnvVar: "CLUSTER_NAME",
EnvVars: []string{"CLUSTER_NAME"},
},
cli.StringFlag{
&cli.StringFlag{
Name: "cluster-namespace",
Usage: "Namespace of the k3k cluster",
Destination: &cfg.ClusterNamespace,
EnvVar: "CLUSTER_NAMESPACE",
EnvVars: []string{"CLUSTER_NAMESPACE"},
},
cli.StringFlag{
&cli.StringFlag{
Name: "cluster-token",
Usage: "K3S token of the k3k cluster",
Destination: &cfg.Token,
EnvVar: "CLUSTER_TOKEN",
EnvVars: []string{"CLUSTER_TOKEN"},
},
cli.StringFlag{
&cli.StringFlag{
Name: "host-config-path",
Usage: "Path to the host kubeconfig, if empty then virtual-kubelet will use incluster config",
Destination: &cfg.HostConfigPath,
EnvVar: "HOST_KUBECONFIG",
EnvVars: []string{"HOST_KUBECONFIG"},
},
cli.StringFlag{
&cli.StringFlag{
Name: "virtual-config-path",
Usage: "Path to the k3k cluster kubeconfig, if empty then virtual-kubelet will create its own config from k3k cluster",
Destination: &cfg.VirtualConfigPath,
EnvVar: "CLUSTER_NAME",
EnvVars: []string{"CLUSTER_NAME"},
},
cli.StringFlag{
&cli.StringFlag{
Name: "kubelet-port",
Usage: "kubelet API port number",
Destination: &cfg.KubeletPort,
EnvVar: "SERVER_PORT",
EnvVars: []string{"SERVER_PORT"},
Value: "10250",
},
cli.StringFlag{
&cli.StringFlag{
Name: "agent-hostname",
Usage: "Agent Hostname used for TLS SAN for the kubelet server",
Destination: &cfg.AgentHostname,
EnvVar: "AGENT_HOSTNAME",
EnvVars: []string{"AGENT_HOSTNAME"},
},
cli.StringFlag{
&cli.StringFlag{
Name: "server-ip",
Usage: "Server IP used for registering the virtual kubelet to the cluster",
Destination: &cfg.ServerIP,
EnvVar: "SERVER_IP",
EnvVars: []string{"SERVER_IP"},
},
cli.StringFlag{
&cli.StringFlag{
Name: "version",
Usage: "Version of kubernetes server",
Destination: &cfg.Version,
EnvVar: "VERSION",
EnvVars: []string{"VERSION"},
},
cli.StringFlag{
&cli.StringFlag{
Name: "config",
Usage: "Path to k3k-kubelet config file",
Destination: &configFile,
EnvVar: "CONFIG_FILE",
EnvVars: []string{"CONFIG_FILE"},
Value: "/etc/rancher/k3k/config.yaml",
},
cli.BoolFlag{
&cli.BoolFlag{
Name: "debug",
Usage: "Enable debug logging",
Destination: &debug,
EnvVar: "DEBUG",
EnvVars: []string{"DEBUG"},
},
}
app.Before = func(clx *cli.Context) error {
@@ -104,7 +104,7 @@ func main() {
}
}
func run(clx *cli.Context) {
func run(clx *cli.Context) error {
ctx := context.Background()
if err := cfg.parse(configFile); err != nil {
logger.Fatalw("failed to parse config file", "path", configFile, zap.Error(err))
@@ -123,4 +123,6 @@ func run(clx *cli.Context) {
}
k.start(ctx)
return nil
}

22
main.go
View File

@@ -14,7 +14,7 @@ import (
"github.com/rancher/k3k/pkg/controller/cluster"
"github.com/rancher/k3k/pkg/controller/clusterset"
"github.com/rancher/k3k/pkg/log"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"go.uber.org/zap"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -34,34 +34,34 @@ var (
debug bool
logger *log.Logger
flags = []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: "kubeconfig",
EnvVar: "KUBECONFIG",
EnvVars: []string{"KUBECONFIG"},
Usage: "Kubeconfig path",
Destination: &kubeconfig,
},
cli.StringFlag{
&cli.StringFlag{
Name: "cluster-cidr",
EnvVar: "CLUSTER_CIDR",
EnvVars: []string{"CLUSTER_CIDR"},
Usage: "Cluster CIDR to be added to the networkpolicy of the clustersets",
Destination: &clusterCIDR,
},
cli.StringFlag{
&cli.StringFlag{
Name: "shared-agent-image",
EnvVar: "SHARED_AGENT_IMAGE",
EnvVars: []string{"SHARED_AGENT_IMAGE"},
Usage: "K3K Virtual Kubelet image",
Value: "rancher/k3k:k3k-kubelet-dev",
Destination: &sharedAgentImage,
},
cli.StringFlag{
&cli.StringFlag{
Name: "shared-agent-pull-policy",
EnvVar: "SHARED_AGENT_PULL_POLICY",
EnvVars: []string{"SHARED_AGENT_PULL_POLICY"},
Usage: "K3K Virtual Kubelet image pull policy must be one of Always, IfNotPresent or Never",
Destination: &sharedAgentImagePullPolicy,
},
cli.BoolFlag{
&cli.BoolFlag{
Name: "debug",
EnvVar: "DEBUG",
EnvVars: []string{"DEBUG"},
Usage: "Debug level logging",
Destination: &debug,
},