juliacomputing / kuber.jl Goto Github PK
View Code? Open in Web Editor NEWJulia Kubernetes Client
License: Other
Julia Kubernetes Client
License: Other
ERROR: Error when installing package Kuber:
AssertionError: length(dirs) == 1
Stacktrace:
[1] install_archive(::Array{String,1}, ::Base.SHA1, ::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Operations.jl:482
[2] macro expansion at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Operations.jl:596 [inlined]
[3] (::getfield(Pkg.Operations, Symbol("##26#29")){Symbol,Pkg.Types.Context,Dict{Base.UUID,Base.SHA1},Dict{Base.UUID,Array{String,1}}})() at .\task.jl:259
The link in the Tutorial points to https://juliacomputing.com/blog/2018/12/15/kuber.html , but this page doesn't exist. I guess the updated link is https://juliacomputing.com/blog/2018/12/kuber/ , but leave it to the maintainers to confirm or refute.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
root_swagger.json
Calling watch
on cluster wide resources like Node
or ClusterRole
results in error:
julia> Kuber.watch(ctx.ctx, Kuber.get, :Node; namespace=nothing) do stream
@show stream
end
stream = Channel{Any}(1024)
ERROR: TaskFailedException
nested task error: ArgumentError: No API functions could be located using Node
Stacktrace:
[1] get(ctx::Kuber.KuberWatchContext, O::Symbol; apiversion::Nothing, label_selector::Nothing, namespace::Nothing, max_tries::Int64, watch::Bool, resource_version::Nothing, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Kuber ~/.julia/packages/Kuber/yHsvl/src/simpleapi.jl:204
[2] macro expansion
@ ~/.julia/packages/Kuber/yHsvl/src/simpleapi.jl:39 [inlined]
[3] (::Kuber.var"#25#28"{Kuber.KuberWatchContext, Channel{Any}, Base.Iterators.Pairs{Symbol, Nothing, Tuple{Symbol}, NamedTuple{(:namespace,), Tuple{Nothing}}}, typeof(get), Tuple{Symbol}})()
@ Kuber ./task.jl:411
Currently the following diff is required to successfully generate code when Custom Resource Definitions (CRDs) are present in swagger.json. Should we commit this diff or should we come up with a better way of handling these CRDs?
diff --git a/gen/gentypealiases.jl b/gen/gentypealiases.jl
index dd4f995..55bb219 100644
--- a/gen/gentypealiases.jl
+++ b/gen/gentypealiases.jl
@@ -9,6 +9,15 @@ const KuberTypeAliasesUnique = Dict{String,Vector{Pair{String,String}}}
const BaseTypes = ("String", "Float64", "Float32", "Int", "Int64", "Int32", "Int16", "UInt", "UInt64", "UInt32", "UInt16", "DateTime", "Bool", "Nothing")
const ModelPrefixes = ("IoK8sApimachineryPkgApis", "IoK8sApimachineryPkg", "IoK8sApi", "IoK8sKubeAggregatorPkgApis", "IoK8sApiextensionsApiserverPkgApis")
+const CrdModelnameApiMap = Dict{String,String}(
+ "OrgProjectcalicoCrdV1" => "CrdProjectcalicoOrgV1",
+ "ComJuliahubV1beta1" => "JuliahubComV1beta1",
+ "ComCoreosDatabaseEtcdV1beta2" => "EtcdDatabaseCoreosComV1beta2",
+ "ShKarpenterV1alpha5" => "KarpenterShV1alpha5",
+ "ComAmazonawsK8sCrdV1alpha1" => "CrdK8sAmazonawsComV1alpha1",
+ "AwsK8sVpcresourcesV1beta1" => "VpcresourcesK8sAwsV1beta1",
+)
+
function get_swagger_ctx_call_return_type(fn_body)
all_calls = findall(x->CSTParser.isbinarysyntax(x), fn_body.args)
for nidx in all_calls
@@ -82,6 +91,14 @@ function kuberapitypes(file::String, aliases_set::KuberTypeAliasesSet)
end
function find_matching_api(sorted_apis::Vector{String}, model_name::String)
+ for modelpfx in keys(CrdModelnameApiMap)
+ if startswith(model_name, modelpfx)
+ api_pfx = CrdModelnameApiMap[modelpfx]
+ api_idx = findfirst(x->startswith(x, api_pfx), sorted_apis)
+ return (api_idx !== nothing) ? api_idx : nothing
+ end
+ end
+
rbac_apis = map(x->startswith(x, "RbacAuthorization") ? replace(x, "Authorization"=>"") : x, sorted_apis)
flowcontrol_apis = map(x->startswith(x, "FlowcontrolApiserver") ? replace(x, "Apiserver"=>"") : x, sorted_apis)
@@ -95,6 +112,12 @@ function find_matching_api(sorted_apis::Vector{String}, model_name::String)
end
function get_common_name(sorted_apis::Vector{String}, model_name::String)
+ for modelpfx in keys(CrdModelnameApiMap)
+ if startswith(model_name, modelpfx)
+ return replace(model_name, modelpfx=>"")
+ end
+ end
+
rbac_apis = map(x->startswith(x, "RbacAuthorization") ? replace(x, "Authorization"=>"") : x, sorted_apis)
flowcontrol_apis = map(x->startswith(x, "FlowcontrolApiserver") ? replace(x, "Apiserver"=>"") : x, sorted_apis)
When the Kubernetes API server is not running KuberContext
can get partially populated which can result in different error messages when retrying the same calls. This can be problematic in scenarios like the CI where a KuberContext
could be re-used:
julia> using Kuber
julia> ctx = KuberContext()
Kubernetes namespace default at http://localhost:8001
julia> get(ctx, :Pod)
ERROR: Swagger.ApiException(500, "Internal Server Error", HTTP.Messages.Response:
"""
HTTP/1.1 500 Internal Server Error
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Wed, 21 Apr 2021 13:53:44 GMT
Content-Length: 40
Connection: close
dial tcp 192.168.49.2:8443: i/o timeout
""")
Stacktrace:
[1] exec(ctx::Swagger.Ctx)
@ Swagger ~/.julia/packages/Swagger/4eKnR/src/client.jl:213
[2] getCoreAPIVersions(_api::Kuber.Kubernetes.CoreApi; _mediaType::Nothing)
@ Kuber.Kubernetes ~/.julia/packages/Kuber/UfXri/src/api/api_CoreApi.jl:17
[3] getCoreAPIVersions
@ ~/.julia/packages/Kuber/UfXri/src/api/api_CoreApi.jl:14 [inlined]
[4] macro expansion
@ ~/.julia/packages/Retry/vS1bg/src/repeat_try.jl:192 [inlined]
[5] fetch_core_version(ctx::KuberContext; override::Nothing, verbose::Bool, max_tries::Int64)
@ Kuber ~/.julia/packages/Kuber/UfXri/src/helpers.jl:162
[6] set_api_versions!(ctx::KuberContext; override::Nothing, verbose::Bool, max_tries::Int64)
@ Kuber ~/.julia/packages/Kuber/UfXri/src/helpers.jl:220
[7] get(ctx::KuberContext, O::Symbol, apiversion::Nothing; label_selector::Nothing, namespace::String, max_tries::Int64)
@ Kuber ~/.julia/packages/Kuber/UfXri/src/simpleapi.jl:90
[8] get (repeats 2 times)
@ ~/.julia/packages/Kuber/UfXri/src/simpleapi.jl:90 [inlined]
[9] top-level scope
@ REPL[3]:1
julia> get(ctx, :Pod)
ERROR: KeyError: key :Pod not found
Stacktrace:
[1] getindex
@ ./dict.jl:482 [inlined]
[2] _get_apictx(ctx::KuberContext, O::Symbol, apiversion::Nothing)
@ Kuber ~/.julia/packages/Kuber/UfXri/src/simpleapi.jl:17
[3] get(ctx::KuberContext, O::Symbol, apiversion::Nothing; label_selector::Nothing, namespace::String, max_tries::Int64)
@ Kuber ~/.julia/packages/Kuber/UfXri/src/simpleapi.jl:92
[4] get (repeats 2 times)
@ ~/.julia/packages/Kuber/UfXri/src/simpleapi.jl:90 [inlined]
[5] top-level scope
@ REPL[3]:1
Hi, Thank you for developing this repo!
I'm wondering can I use Kuber.jl within a pod, and access the Kubernetes API? As far as I know, both Go and Python have client that can do so, like here.
This will be a great help!
Kuber.jl does not support invoking API watches that do long polling and return stream of events. It will be very useful to have a way to use those, instead of repeated polling. A related change is needed in Swagger.jl - JuliaComputing/Swagger.jl#41
We face the issue that deleting a Job does not delete the containing Pods.
We'd like to set the propagationPolicy
to "Background"
. It seems that propagationPolicy
is implemented in the ApiImpl
, but I was not able to find a solution to set this Parameter by applying it to the ctx.client
or so. What would be a possible way to do so?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.