I am using skuber 2.4.0.
Is there a way to use the skuber client.delete an object in a specific namespace?
I understand that when I create a client I can specify a namespace.
But for example when creating a job you can specify any namespace in the metadata.
Seems weird to need to create a new client just for deletion.
I suggest you open an issue in the github repo for further help.
https://github.com/hagay3/skuber/issues
EDIT:
Namespaces API is now available in version 2.7.6
It's possible to provide namespace in every client endpoint.
https://github.com/hagay3/skuber/releases/tag/v2.7.6
OLD ANSWER:
Regarding your question, you can use the following method:
def usingNamespace(newNamespace: String): KubernetesClient
https://github.com/hagay3/skuber/blob/master/client/src/main/scala/skuber/api/client/KubernetesClient.scala#L366
example:
https://github.com/hagay3/skuber/blob/master/client/src/it/scala/skuber/NamespaceSpec.scala#L53
Related
I know that every command that I enter in Kubernetes communicate with API.
Now I want to speak to API directly.
How can I find json format for every command?
I suggest using a client library if you talk from a programming language:
https://kubernetes.io/docs/reference/#api-client-libraries
Or use kubectl if you talk from CLI. Hardcoding API schemas will add you a maintenance burden. You're basically reimplementing the client in this case.
Following is the kubernetes API reference docs, you can find equivalent API for each resources here:
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/
Hope this helps
I would just like to rename the bosh deployment name.
Is there a easy and safe way to change the name?
Do I need to edit the bosh director database?
There is no supported way to change the name of a deployment which is considered the unique key for across all deployments managed by the same director.
The documents suggest that a future enhancement to CLI's edit action might address that:
Currently name provided via --deployment (-d) flag must match name
specified in the manifest.
https://bosh.io/docs/cli-v2.html#deployment-mgmt
And echoed in a open feature https://github.com/cloudfoundry/bosh/issues/976 I suggest you add your vote and comments there.
I've been setting up CloudFormation templates for some new infrastructure for a project and I've made it to Route 53 Hosted Zones.
Now ideally I'd like to create a "core-domains" stack with all our hosted zones and base configuration. Thing is we already have these created manually using the AWS console (and they're used for test/live infrastructure), is there any way to supply the existing "HostedZoneId" as a property to the resource definition and essentially have it introspect what we already have and then apply the diff? (If I've done my job there shouldn't be a diff hopefully so should just be a no-op!).
I can't see a "HostedZoneId" property in the docs: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53-hostedzone.html
Any suggestions?
PS. I'm assuming this isn't possible and I'll have to recreate all the HostedZones under CloudFormation but I thought I'd check :)
Found it. It's fine to make other HostedZones, they're issued with new Nameservers, just use the "HostedZoneConfig: Comment" field to note down which hosted zone is which and then you can switch the nameservers over when you're ready!
What is the role of types.generated.go
What is it generated from?
What is it's usage?
I see a section in code like:
if yyq2[7] { z.EncSendContainerState(codecSelfer_containerMapKey1234)
what does things like yyq2 are?
First, k8s use gengo to generate code.
There are several project in kubernetes/cmd/libs/go2idl, such as go-to-protobuf, client-gen, set-gen,lister-gen.
K8s generate protobuf from go struct by go-to-protobuf. The generate script define in kubernetes/hack/update-generated-protobuf.sh
K8s generate client and util source code by client-gen, set-gen, lister-gen, the generate script define in kubernetes/hack/update-codegen.sh
K8s generate types.generated.go by go/codec, the generate script define in kubernetes/hack/update-codecgen.sh. The type in types.generated.go is for rpc serialization.
I'm trying to retrieve projects metrics using the REST Api. Therefore I first query the projects using "/api/projects/index". Afterwards I retrieve the metrics using "/api/metrics/search". Both works fine. And I result with:
[id:35476, k:com.test:TestProject, nm:TestProject, qu:TRK, sc:PRJ]
[custom:false, description:Cyclomatic complexity, direction:-1, domain:Complexity, hidden:false, id:10019, key:complexity, name:Complexity, qualitative:false, type:INT]
Now I wanted to retrieve a projects metrics. Therefore I use the following URL:
https://MYHOST/sonarqube/api/timemachine/index?resource=35476&metric=10019&fromDateTime=2010-12-25T23:59:59+0100&toDateTime=2018-12-25T23:59:59+0100
There the server retruns only: [{"cols":[],"cells":[]}]
This surprices me, because when I enter the WebInterface of sonar for the project, I can see numbers. I tried some other metrics, however all ended with the same result. What am I doing wrong?
You didn't mention server version, so I'll assume the latest: 5.2.
I got the same result for a bare query (http://nemo.sonarqube.org/api/timemachine/index), and for a query which specified resource but not metrics (http://nemo.sonarqube.org/api/timemachine/index?resource=org.sonarsource.sonarqube%3Asonarqube).
So I'm guessing there's a problem with either your resource or metric id. Try using the keys (com.test&%3ATestProject, and complexity) instead.
And yes, the ids you got back from the other web services should work here, but what's meant by "id" can be a little... ah... variable from service to service to service.