Commit Graph

77 Commits

Author SHA1 Message Date
D8D Developer
fe5cf87558 📝 docs(project): 添加项目文档文件
All checks were successful
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Successful in 5m29s
- 创建 CLAUDE.md 项目说明文档
- 包含项目概述、关键命令、架构说明和开发指南
- 提供主要文件说明和开发环境要求
- 添加测试、构建和 CI/CD 相关信息
2025-09-08 11:19:28 +00:00
D8D Developer
64e6342b95 feat(eci): 支持通过注解指定ECS规格
All checks were successful
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Successful in 4m30s
- 添加对k8s.aliyun.com/eci-use-specs注解的解析
- 将注解值作为InstanceType参数传递给ECI创建请求
2025-07-10 06:18:15 +00:00
D8D Developer
41e03d0f49 🐛 fix(eci): 修正自动创建EIP参数类型
All checks were successful
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Successful in 4m13s
- 将AutoCreateEip参数从布尔值改为使用requests.Boolean类型
- 保持原有功能不变但符合API参数要求
2025-07-01 07:55:52 +00:00
D8D Developer
70ba5ff245 已在 eci/create_container_group.go 文件的 CreateContainerGroupRequest 结构体中添加了 AutoCreateEip 字段
Some checks failed
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Failing after 3m50s
2025-07-01 07:42:52 +00:00
D8D Developer
6c0ffc0567 🐛 fix(eci): 移除抢占式实例持续时间配置
All checks were successful
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Successful in 5m16s
- 注释掉 SpotDuration 参数设置
- 在 CreateContainerGroupRequest 结构中注释掉 SpotDuration 字段
2025-07-01 06:51:04 +00:00
df7b5af263 更新 eci.go
Some checks failed
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Failing after 3m56s
2025-07-01 05:41:29 +00:00
a01503f2aa 修改 CreatePod 方法以添加抢占式实例配置
Some checks failed
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Has been cancelled
2025-07-01 05:40:20 +00:00
f067bf1186 添加 .github/workflows/build.yaml
All checks were successful
Virtual Kubelet Docker Build and Deploy / build-and-deploy (push) Successful in 4m22s
2025-07-01 03:49:11 +00:00
4838d89b4a 添加 Dockerfile 2025-07-01 03:47:55 +00:00
Brian Goff
633a6061f1 Merge pull request #5 from denverdino/master
Fix go.mod
2020-01-13 09:48:11 -08:00
Li Yi
c9f0567907 Fix go.mod
Signed-off-by: Li Yi <denverdino@gmail.com>
2020-01-04 19:47:29 +08:00
Brian Goff
3858dfe099 Deprecate "provider" flag
This is also deprecated on other provider CLI's since it doesn't make sense to specify one.
2019-06-17 11:47:18 -07:00
Brian Goff
0d635b423d Remove "AZURE*" copy pasta 2019-06-17 11:33:52 -07:00
Brian Goff
34c355d3fa Add project stuff for CI/make/etc 2019-06-14 12:54:53 -07:00
Brian Goff
a894106043 Fixup items after move provider from vk/vk 2019-06-14 12:54:49 -07:00
Brian Goff
38456348d6 Copy cmd/ from vk/vk 2019-06-14 11:52:44 -07:00
Brian Goff
a70d4f9499 Move cli back into cmd/ after filter branch 2019-06-14 11:51:32 -07:00
Brian Goff
9d9bd9cca5 Add license details on file heads. (#665)
Realized as I was starting to copy some stuff to other repos that we
should go ahead and add this.
2019-06-13 10:13:14 -07:00
Brian Goff
bbf5af22c1 Remove resourcemanager from conroller public API (#664)
We still use it internally, but this does not need to be part of the
public API. Instead just have callers pass us the relevent listers and
we create our own resource manager.
2019-06-12 13:42:03 -07:00
Brian Goff
96024a7a0e Move around some packages (#658)
* Move tracing exporter registration

This doesn't belong in the library and should be configured by the
consumer of the opencensus package.

* Rename `vkublet` package to `node`

`vkubelet` does not convey any information to the consumers of the
package.
Really it would be nice to move this package to the root of the repo,
but then you wind up with... interesting... import semantics due to the
repo name... and after thinking about it some, a subpackage is really
not so bad as long as it has a name that convey's some information.

`node` was chosen since this package deals with all the semantics of
operating a node in Kubernetes.
2019-06-12 13:11:49 +01:00
Brian Goff
2b76578994 Move around some packages (#658)
* Move tracing exporter registration

This doesn't belong in the library and should be configured by the
consumer of the opencensus package.

* Rename `vkublet` package to `node`

`vkubelet` does not convey any information to the consumers of the
package.
Really it would be nice to move this package to the root of the repo,
but then you wind up with... interesting... import semantics due to the
repo name... and after thinking about it some, a subpackage is really
not so bad as long as it has a name that convey's some information.

`node` was chosen since this package deals with all the semantics of
operating a node in Kubernetes.
2019-06-12 13:11:49 +01:00
Brian Goff
b6eeb88316 Update node defaults
Do not enable leases by default in the node constructor.
Simplify node constructor to not require a lease client when leases may
not even be enabled.

Updates node status update interval to the kubelet default of 10s (was
5s in vk).
2019-06-10 10:31:37 -07:00
Brian Goff
6afc53f0e9 Use errdefs package 2019-06-04 14:29:23 -07:00
Brian Goff
bbcc1f38c9 Use errdefs package 2019-06-04 14:29:23 -07:00
Brian Goff
76ea287332 Support error handler callback for node status (#648)
This moves the logic for re-creating the a missing node up into the CLI.
We can make this optional, but for now I've just preserved existing
functionality.
2019-06-01 09:46:47 -07:00
Brian Goff
ddee513763 Remove Server object (#629)
This had some weird shared responsibility with the PodController.
Instead just move the functionality to the PodController.
2019-06-01 09:36:38 -07:00
Sargun Dhillon
ae69cc749f Upgrade to Go 1.12 (#630) 2019-05-20 11:39:47 +01:00
Brian Goff
6743e4ff20 Decouple vkubelet/* packages from providers (#626)
This makes the concept of a `Provider` wholely implemented in the cli
implementation in cmd/virtual-kubelet.

It allows us to slim down the interfaces used in vkubelet (and
vkubelet/api) to what is actually used there rather than a huge
interface that is only there to serve the CLI's needs.
2019-05-17 17:01:05 -07:00
Brian Goff
ac947b10b8 Decouple vkubelet/* packages from providers (#626)
This makes the concept of a `Provider` wholely implemented in the cli
implementation in cmd/virtual-kubelet.

It allows us to slim down the interfaces used in vkubelet (and
vkubelet/api) to what is actually used there rather than a huge
interface that is only there to serve the CLI's needs.
2019-05-17 17:01:05 -07:00
Sargun Dhillon
de467d41e9 Add the /runningpods/ api endpoint (#611)
* Add the /runningpods/ api endpoint

This adds an API endpoint from the kubelet (/runningpods/). It is
an endpoint on kubelet which is considered a "debug" endpoint, so
it might be worth exposing through the options, but by default
it is exposed in most k8s configs AFAICT.
2019-05-13 15:10:31 -07:00
Sargun Dhillon
59d021f644 Fix being able to set the VK's listening port 2019-05-08 17:18:42 -07:00
Brian Goff
00ea9dc763 Use I/O stream for provider logs interface
Providers must still update the implementaiton to actually gain any
benefit here, but this makes the provider interface a bit more sane.
2019-05-08 09:17:29 -07:00
Sargun Dhillon
2497028659 Add the ability to configure klog from VK (#595)
All of Kubernetes logging is based on klog. Klog currently does
not output any logging information to logrus, so you're flying
somewhat blind to Kubernetes internals.

This exposes the full set of configurables that klog offers,
but decorates (prefixes) the klog configuration with "klog".
2019-05-08 11:37:04 +01:00
Brian Goff
8eb6a5bcc5 Merge branch 'master' into error-on-zpages-failure 2019-05-07 09:14:08 -07:00
Sargun Dhillon
6762301668 Remove old github.com/Sirupsen/logrus 2019-05-06 17:26:05 -07:00
Sargun Dhillon
6d49bb981c Do not swallow errors from the zpages server silently
If the zpages server exits for any reason, or is unable to bind,
rather than exiting silently, throw an error.
2019-05-06 11:10:17 -07:00
Sargun Dhillon
764cb5a76e Add the concept of startup timeout (#597)
This adds two concepts, where one encompasses the other.

Startup timeout
Startup timeout is how long to wait for the entire kubelet
to get into a functional state. Right now, this only waits
for the pod informer cache for the pod controllerto become
in-sync with API server, but this could be extended to other
informers (like secrets informer).

Wait For Startup
This changes the behaviour of the virtual kubelet to wait
for the pod controller to start before registering the node.

It is to avoid the race condition where the node is registered,
but we cannot actually do any pod operations.
2019-05-06 09:25:00 -07:00
Brian Goff
c346a7f5b8 Refactor exec interface (#578)
This removes the dependence on remotecommand in providers as well as the
need to expose provider ID's for the sake of the ExecInContainer API.
2019-04-26 12:57:56 -07:00
Sargun Dhillon
4b0c6815eb Stop using deprecated method Clientset.Coordination (#581)
Clientset.Coordination is deprecated. We are meant to use the specific
version of the client: CoordinationV1beta1. Clientset.Coordination is
going to be removed in future versions of the client API.
2019-04-23 14:17:15 -07:00
Brian Goff
ed5f478b9b Don't set cancel function to nil on error (#579)
When setting up the http server we return a cancel function to close all
the listeners down.
The issue here is we set the cancel function to nil and thereby cause a
panic when there is an error and the `defer` attempts to call cancel.

This fix just don't set a named return value for the cancel function to
make sure we don't overwrite it with a `return nil, err`.
This ensures that the `defer` can still call `cancel()`.
2019-04-22 10:31:06 -07:00
Brian Goff
57e8ee4b51 Refactor CLI initialization (#562)
This cleans up the CLI code significantly.
Also makes some of this re-usable for providers who want to do so.

This also removes the main.go from the top of the tree of the repro,
instead moving it into cmd/virtual-kubelet.
This allows us to better utilize the package namespace (and e.g. mv the
`vkubelet` package to the top of the tree).
2019-04-19 17:02:39 -07:00
Yash Desai
40160ad36f Resource manager: add service lister and remove unused lock. (#559)
* Remove unused lock from the resource manager.

* Add service lister to the resource manager.

This change adds a service lister in the
resource manager.
This will be used to set the service env vars.
Also added a List method to the resource manager
and a simple test to confirm it's a pass through.
2019-04-03 11:19:30 -07:00
Brian Goff
b7a52a9332 Add node provider interfaace (#526)
This starts the work of having a `NodeProvider` which is responsible for
providing node details.
It splits the responsibilities of node management off to a new
controller.

The primary change here is to add the framework pieces for node
management and move the VK CLI to use this new controller.

It also adds support for node leases where available. This can be
enabled via the command line (disabled by default), but may fall back if
we find that leaess aren't supported on the cluster.
2019-03-25 15:02:40 -07:00
Brian Goff
dafd60fd52 Support building an allow-list of providers (#527)
* Add providers subcommand to verify providers

Allows users to check what providers are available

* Fix version output to add new line

This command was totally broken until we moved around the call to
`initConfig()`, this just fixes the output now that it works.

* Flip boolean of provider include tags

All providers are still included by default and fix tags using the old
format.
2019-03-02 11:25:47 -08:00
Brian Goff
b491ac3e27 Make tracing interface to coalesce logging/tracing (#519)
* Define and use an interface for logging.

This allows alternative implementations to use whatever logging package
they want.

Currently the interface just mimicks what logrus already implements,
with minor modifications to not rely on logrus itself. I think the
interface is pretty solid in terms of logging implementations being able
to do what they need to.

* Make tracing interface to coalesce logging/tracing

Allows us to share data between the tracer and the logger so we can
simplify log/trace handling wher we generally want data to go both
places.
2019-02-22 11:36:03 -08:00
Brian Goff
ac0551e8c2 fix potential panic on http server close (#496) 2019-01-15 10:37:06 -08:00
muya-zj
e9e5c47037 [AlibabaCloud] Change alicloud to alibabacloud (#470) 2018-12-26 06:42:56 -08:00
Brian Goff
fe0170fc5c Refactor http server stuff (#466)
* Don't start things in New

* Move http server handling up to daemon.

This removes the burdern of dealing with listeners, http servers, etc in
the core framework.

Instead provide helpers to attach the appropriate routes to the
caller's serve mux.

With this change, the vkubelet package only helps callers setup HTTP
rather than forcing a specific HTTP config on them.
2018-12-21 11:45:07 -08:00
Brian Goff
3ec1b5a587 Revert "Use 1 worker by default" (#432)
This reverts commit f10596562dac6623650f7871758325b9f106c420.

Makes our default worker count back to 10 now that concurrency is in
good shape.
2018-12-03 12:49:03 -08:00
Paulo Pires
b4c42a01c1 use shared informers and workqueue (#425)
* vendor: add vendored code

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* controller: use shared informers and a work queue

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* errors: use cpuguy83/strongerrors

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* aci: fix test that uses resource manager

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* readme: clarify skaffold run before e2e

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* cmd: use root context everywhere

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: refactor pod lifecycle management

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* e2e: fix race in test when observing deletions

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* e2e: test pod forced deletion

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* cmd: fix root context potential leak

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: rename metaKey

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: remove calls to HandleError

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* Revert "errors: use cpuguy83/strongerrors"

This reverts commit f031fc6d.

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* manager: remove redundant lister constraint

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: rename the pod event recorder

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: amend misleading comment

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* mock: add tracing

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: add tracing

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* test: observe timeouts

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* trace: remove unnecessary comments

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: limit concurrency in deleteDanglingPods

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: never store context, always pass in calls

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: remove HandleCrash and just panic

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: don't sync succeeded pods

Signed-off-by: Paulo Pires <pjpires@gmail.com>

* sync: ensure pod deletion from kubernetes

Signed-off-by: Paulo Pires <pjpires@gmail.com>
2018-11-30 15:53:58 -08:00