kubernetes / api Goto Github PK
View Code? Open in Web Editor NEWThe canonical location of the Kubernetes API definition.
License: Apache License 2.0
The canonical location of the Kubernetes API definition.
License: Apache License 2.0
I encountered this problem when using the istio client-go 1.4
,i found that my k8s/api
version was updated along with it. the command to execute is:
$ go get istio.io/[email protected]
$ go build -o beyondmesh
build beyondcent.com/beyondmesh/src/api: cannot load k8s.io/api/admissionregistration/v1alpha1: module k8s.io/api@latest found (v0.17.3), but does not contain package k8s.io/api/admissionregistration/v1alpha1
I found that the v1alpha1
package had been removed in release-1.14
Is there any relevant change log
?
One thing I don't understand is why the k8s/api is updated when I update the istio client-go? Is it because istio relies on k8s?
This flag was added in k8s 1.8 https://kubernetes.io/docs/api-reference/v1.8/
A TODO statement is being rendered inside the OpenShift UI when trying to create an instance of an operator. This code is coming from core/v1
: https://github.com/kubernetes/api/blob/master/core/v1/types.go#L5268
Currently the description at the top of this repo seems to be outdated, at least the "Soon-to-be" part:
Soon-to-be the canonical location of the Kubernetes API definition.
cc @lavalamp
hi:
when I build kubectl on my PC, I found this error:'undefined: "k8s.io/api/core/v1".RBDPersistentVolumeSource' , and i cant find "RBDPersistentVolumeSource" defined in the package "k8s.io/api/core/v1" , how to fix this ? thanks !
When installing various pieces of k8s tools, I keep running into this error from go get
(and its module support):
$ go get -d github.com/rancher/rancher
[.. elided ..]
go: k8s.io/[email protected] requires
k8s.io/[email protected]: reading k8s.io/api/go.mod at revision v0.0.0: unknown revision v0.0.0
(This feels like maybe a tag got made that wasn't supposed to?)
Why is the type of StorageClassName
pointer to string instead of just string?
Line 486 in 5bb35d2
As per the email sent to kubernetes-dev[1], please create a SECURITY_CONTACTS
file.
The template for the file can be found in the kubernetes-template repository[2].
A description for the file is in the steering-committee docs[3], you might need
to search that page for "Security Contacts".
Please feel free to ping me on the PR when you make it, otherwise I will see when
you close this issue. :)
Thanks so much, let me know if you have any questions.
(This issue was generated from a tool, apologies for any weirdness.)
[1] https://groups.google.com/forum/#!topic/kubernetes-dev/codeiIoQ6QE
[2] https://github.com/kubernetes/kubernetes-template-project/blob/master/SECURITY_CONTACTS
[3] https://github.com/kubernetes/community/blob/master/committee-steering/governance/sig-governance-template-short.md
Hi Team,
Let's see https://github.com/kubernetes/api/blob/v0.30.0/go.mod
// This is a generated file. Do not edit directly.
module k8s.io/api
go 1.22.0
Please take into account that the Go version specified in the v0.30.0 mod file is 1.22.0. Consequently, it necessitates that any Golang modules relying on v0.30.0 must also adhere to the precise Golang version number
is it possible to use the Golang version without the patch number in later versions? For example https://github.com/kubernetes/api/blob/v0.29.4/go.mod
the code of master can't build success! it's some error like :
../../project/src/k8s.io/api/authentication/v1/zz_generated.deepcopy.go:61: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no fieldor method DeepCopyInto)
# k8s.io/api/certificates/v1beta1
../../project/src/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go:65: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/certificates/v1beta1/zz_generated.deepcopy.go:93: in.LastUpdateTime.DeepCopyInto undefined (type v1.Time has no field or method DeepCopyInto)
# k8s.io/api/authorization/v1beta1
../../project/src/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go:77: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go:138: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/authorization/v1beta1/zz_generated.deepcopy.go:201: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
# k8s.io/api/admissionregistration/v1alpha1
../../project/src/k8s.io/api/admissionregistration/v1alpha1/zz_generated.deepcopy.go:140: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/admissionregistration/v1alpha1/zz_generated.deepcopy.go:240: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
# k8s.io/api/authentication/v1beta1
../../project/src/k8s.io/api/authentication/v1beta1/zz_generated.deepcopy.go:61: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
# k8s.io/api/storage/v1
../../project/src/k8s.io/api/storage/v1/zz_generated.deepcopy.go:53: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
# k8s.io/api/rbac/v1alpha1
../../project/src/k8s.io/api/rbac/v1alpha1/zz_generated.deepcopy.go:89: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/rbac/v1alpha1/zz_generated.deepcopy.go:123: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field ormethod DeepCopyInto)
../../project/src/k8s.io/api/rbac/v1alpha1/zz_generated.deepcopy.go:265: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field ormethod DeepCopyInto)
../../project/src/k8s.io/api/rbac/v1alpha1/zz_generated.deepcopy.go:299: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field ormethod DeepCopyInto)
# k8s.io/api/scheduling/v1alpha1
../../project/src/k8s.io/api/scheduling/v1alpha1/zz_generated.deepcopy.go:53: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
# k8s.io/client-go/tools/clientcmd/api
../../project/src/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go:111: val.DeepCopyObject undefined (type runtime.Object has no field or method DeepCopyObject)
../../project/src/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go:166: val.DeepCopyObject undefined (type runtime.Object has no field or method DeepCopyObject)
../../project/src/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go:230: val.DeepCopyObject undefined (type runtime.Object has no field or method DeepCopyObject)
../../project/src/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go:266: val.DeepCopyObject undefined (type runtime.Object has no field or method DeepCopyObject)
../../project/src/k8s.io/client-go/tools/clientcmd/api/zz_generated.deepcopy.go:293: val.DeepCopyObject undefined (type runtime.Object has no field or method DeepCopyObject)
# k8s.io/api/policy/v1beta1
../../project/src/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go:67: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field ormethod DeepCopyInto)
../../project/src/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go:74: (*in).DeepCopyInto undefined (type *v1.DeleteOptions has no field or method DeepCopyInto)
../../project/src/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go:103: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go:180: (*in).DeepCopyInto undefined (type *v1.LabelSelector has no field or method DeepCopyInto)
../../project/src/k8s.io/api/policy/v1beta1/zz_generated.deepcopy.go:212: invalid indirect of val.DeepCopy() (type v1.Time)
# k8s.io/api/authorization/v1
../../project/src/k8s.io/api/authorization/v1/zz_generated.deepcopy.go:77: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/authorization/v1/zz_generated.deepcopy.go:138: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no fieldor method DeepCopyInto)
../../project/src/k8s.io/api/authorization/v1/zz_generated.deepcopy.go:201: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no fieldor method DeepCopyInto)
# k8s.io/api/storage/v1beta1
../../project/src/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go:53: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
# k8s.io/api/rbac/v1beta1
../../project/src/k8s.io/api/rbac/v1beta1/zz_generated.deepcopy.go:89: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/rbac/v1beta1/zz_generated.deepcopy.go:123: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/rbac/v1beta1/zz_generated.deepcopy.go:265: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/rbac/v1beta1/zz_generated.deepcopy.go:299: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
# k8s.io/api/core/v1
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:897: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1013: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1079: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1440: in.StartedAt.DeepCopyInto undefined (type v1.Time has no field or method DeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1457: in.StartedAt.DeepCopyInto undefined (type v1.Time has no field or method DeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1458: in.FinishedAt.DeepCopyInto undefined (type v1.Time has no field or method DeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1788: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1967: in.ObjectMeta.DeepCopyInto undefined (type v1.ObjectMeta has no field or method DeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1970: in.FirstTimestamp.DeepCopyInto undefined (type v1.Time has no field or methodDeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1971: in.LastTimestamp.DeepCopyInto undefined (type v1.Time has no field or method DeepCopyInto)
../../project/src/k8s.io/api/core/v1/zz_generated.deepcopy.go:1971: too many errors
Line 1706 in 7d47955
"k8s.io/api"
is using the deprecated "github.com/gogo/protobuf"
Is it possible to remove this deprecated module and replace it with a suitable alternative?
From https://github.com/kubernetes/kubernetes/releases, both v1.11.0-beta.1
and v1.11.0-beta.0
are tagged in kubernetes/kubernetes, would the same version be tagged here as well? I did see the alpha one (e.g. kubernetes-1.11.0-alpha.2
) but not beta.
(We are experiencing some compilation issue while updating vendor.)
Hi
In my go.mod:
...
require (
github.com/golang/protobuf v1.3.1
k8s.io/api kubernetes-1.13.5
k8s.io/client-go v10.0.0
...}
However, when I build, I kept getting errors because it's pulling "k8s.io/api/admissionregistration/v1alpha1 latest". I tried adding k8s.io/api/admissionregistration/v1alpha1 kubernetes-1.13.5, but it complained about no go.mod in api/addmissionregistration. Could you tell me how to solve this issue? Is my configuration done incorrectly?
user@virt-8876$ go build test/client.go
go: finding k8s.io/api kubernetes-1.13.5
go: finding k8s.io/api/admissionregistration/v1alpha1 latest
go: finding k8s.io/api/admissionregistration latest
go: finding k8s.io/api latest
build command-line-arguments: cannot load k8s.io/api/admissionregistration/v1alpha1: cannot find module providing package k8s.io/api/admissionregistration/v1alpha1
I have a coreDNS deployment that is unable to reach the kubernetes api
E0408 16:39:27.779433 1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:355: Failed to list *v1.Namespace: Get https://10.100.0.1:443/api/v1/namespaces?limit=500&resourceVersion=0: dial tcp 10.100.0.1:443: i/o timeout
E0408 16:39:27.779861 1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:348: Failed to list *v1.Service: Get https://10.100.0.1:443/api/v1/services?limit=500&resourceVersion=0: dial tcp 10.100.0.1:443: i/o timeout
E0408 16:39:27.779928 1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:350: Failed to list *v1.Endpoints: Get https://10.100.0.1:443/api/v1/endpoints?limit=500&resourceVersion=0: dial tcp 10.100.0.1:443: i/o timeout
E0408 16:39:58.781491 1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:355: Failed to list *v1.Namespace: Get https://10.100.0.1:443/api/v1/namespaces?limit=500&resourceVersion=0: dial tcp 10.100.0.1:443: i/o timeout
E0408 16:39:58.781715 1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:348: Failed to list *v1.Service: Get https://10.100.0.1:443/api/v1/services?limit=500&resourceVersion=0: dial tcp 10.100.0.1:443: i/o timeout
E0408 16:39:58.782838 1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:350: Failed to list *v1.Endpoints: Get https://10.100.0.1:443/api/v1/endpoints?limit=500&resourceVersion=0: dial tcp 10.100.0.1:443: i/o timeout
E0408 16:40:29.782060 1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:355: Failed to list *v1.Namespace: Get https://10.100.0.1:443/api/v1/namespaces?limit=500&resourceVersion=0: dial tcp 10.100.0.1:443: i/o timeout
E0408 16:40:29.784090 1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:348: Failed to list *v1.Service: Get https://10.100.0.1:443/api/v1/services?limit=500&resourceVersion=0: dial tcp 10.100.0.1:443: i/o timeout
E0408 16:40:29.784374 1 reflector.go:205] github.com/coredns/coredns/plugin/kubernetes/controller.go:350: Failed to list *v1.Endpoints: Get https://10.100.0.1:443/api/v1/endpoints?limit=500&resourceVersion=0: dial tcp 10.100.0.1:443: i/o timeout
2019/04/08 16:40:37 [INFO] SIGTERM: Shutting down servers then terminating
Im running EKS, it has one worker node so everything should be running on the same EC2 instance. I have been unable to access the kubernetes api logs due to some permission issues, any advice or suggestions would be appreciated.
The core.v1.Resource object contains methods for Cpu, Memory, Pods, and EphermalStorage, but does not contain a method for just Storage.
I've been playing with git filter-branch
commands to preserve the history of k8s.io/kubernetes/pkg/api and k8s.io/kubernetes/pkg/apis, the result is https://github.com/caesarxuchao/api.
It has ~4000 commits (~half of them are merge commits) that touched pkg/api and pkg/apis. If you run git log --follow core/v1/types.go
from HEAD, it will show you all the commits that changed pkg/api/v1/types.go, and the commit where i moved pkg/api/v1/types.go to core/v1/types.go. I think in terms of "preserving commit history", it's good enough.
I also append Kubernetes-commit: xxx
to the commit messages so people can find the original commit in k8s.io/kubernetes.
Please let me know if you have other concerns.
If no one objects, i'll push the commits to the master branch of k8s.io/api.
@lavalamp @justinsb @bgrant0607 @kubernetes/sig-api-machinery-misc
I noticed that v1.AdmissionRequest does not implement the runtime.Object
interface. I am curious if there is a specific reason for not doing that. Right now I need to work around this since I cannot assign v1.AdmissionRequest
to runtime.Object
variables
API Version: k8s.io/api v0.29.1
Golang Version: 1.21
I wrote a function to build appv1.Deployment
manually, just like below:
func buildDeployment(cpu, mem string) appsv1.Deployment {
replicas := new(int32)
*replicas = 1
deployment := appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "my-deployment",
},
Spec: appsv1.DeploymentSpec{
Replicas: replicas,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": "my-app",
},
},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"app": "my-app",
},
},
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "my-container",
Image: "my-image",
Resources: corev1.ResourceRequirements{
Limits: corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse(mem),
corev1.ResourceCPU: resource.MustParse(cpu),
},
},
},
},
},
},
},
}
return deployment
}
I did a simple test after, then I found a weird stuff:
func TestBuildDeployment(t *testing.T) {
deployment := buildDeployment("4", "8Gi")
mem := deployment.Spec.Template.Spec.Containers[0].Resources.Limits["memory"]
t.Logf("%+v\n", mem)
deployment2 := buildDeployment("4", "12Gi")
mem2 := deployment2.Spec.Template.Spec.Containers[0].Resources.Limits["memory"]
t.Logf("%+v\n", mem2)
}
// output:
=== RUN TestBuildDeployment
e:\..skip..\k8sapp_test.go:12: {i:{value:8589934592 scale:0} d:{Dec:<nil>} s: Format:BinarySI}
e:\..skip..\k8sapp_test.go:16: {i:{value:12884901888 scale:0} d:{Dec:<nil>} s:12Gi Format:BinarySI}
--- PASS: TestBuildDeployment (0.00s)
Notice the s
of Quantity
object, 8Gi mem is empty, but 12Gi showed up.
When I changed 8Gi to 16Gi, 32Gi, they were all empty string as well.
I have no idea why like this, please help me out, thank you!
Hello!
I have a working validator on the Openschift and Kubernetis clusters. Then I wanted to add warnings.
As example:
From the container side, the response goes away with warning, but no warning appears either in the terminal or in the interface.
Kubernetes Version: v1.19.0+9c69bdc
I did everything according to:
Can you help with this?
https://github.com/kubernetes/api/blob/master/apps/v1/types.go#L411
The docstring defines readyReplicas
as "Total number of ready pods targeted by this deployment" which is defining "ready" in terms of being "ready". Please clarify the docstring on what "ready" means in this context since the docstring is used for the user-facing docs at https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/deployment-v1/.
Fixing this will also resolve kubernetes/website#28316
Why don't v1beta1.IngressLoadBalancerStatus and networking v1.IngressLoadBalancerStatus and corev1.LoadBalancerStatus and v1.LoadBalancerStatus reuse the same structure, so that the upper layer call will be more convenient
Versions before 1.26 returned v1.LoadBalancerStatus, why was version 1.26 removed?
I have used extensions/v1beta1
library to create ingress in my operator. I'm using operator-sdk
to develop the operator. Here is the ingress structure creation code I have used.
func (reconcileSiddhiProcess *ReconcileSiddhiProcess) loadBalancerForSiddhiProcess(m *siddhiv1alpha1.SiddhiProcess) *extensionsv1beta1.Ingress {
ingress := &extensionsv1beta1.Ingress{
TypeMeta: metav1.TypeMeta{
APIVersion: "extensions/v1beta1",
Kind: "Ingress",
},
ObjectMeta: metav1.ObjectMeta{
Name: m.Name,
Namespace: m.Namespace,
Annotations: map[string]string{
"kubernetes.io/ingress.class": "nginx",
"nginx.ingress.kubernetes.io/rewrite-target": "/",
"nginx.ingress.kubernetes.io/ssl-redirect": "false",
"nginx.ingress.kubernetes.io/force-ssl-redirect": "false",
"nginx.ingress.kubernetes.io/ssl-passthrough": "true",
"nginx.ingress.kubernetes.io/affinity": "cookie",
"nginx.ingress.kubernetes.io/session-cookie-name": "route",
"nginx.ingress.kubernetes.io/session-cookie-hash": "sha1",
},
},
Spec: extensionsv1beta1.IngressSpec{
Rules: []extensionsv1beta1.IngressRule{
{
IngressRuleValue: extensionsv1beta1.IngressRuleValue{
HTTP: &extensionsv1beta1.HTTPIngressRuleValue{
Paths: []extensionsv1beta1.HTTPIngressPath{
{
Path: "/",
Backend: extensionsv1beta1.IngressBackend{ServiceName: m.Name, ServicePort: intstr.IntOrString{Type: Int, IntVal: 8006}},
},
},
},
},
},
},
},
}
When I build the operator image and deploy in my minikube
cluster and the Service and Deployment created successfully. But Ingress did not create and gives an error like below.
E0401 15:22:25.956017 1 reflector.go:134] sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:196: Failed to list *v1beta1.Ingress: ingresses.extensions is forbidden: User "system:serviceaccount:default:siddhi-operator" cannot list resource "ingresses" in API group "extensions" in the namespace "default"
I just change the namespace and do it. But it also gives the same error.
Hi
I'm working on a simple application that retrieves a limited list of pods within a particular namespace.
However, I occasionally encounter the error message "The resourceVersion for the provided list is too old."
It's surprising because the ListPods API doesn't use the "resourceVersion" parameter.
To provide some context, the cluster I'm working with has around 10,000 pods.
Here's an example snippet of my code:
listOptions := metav1.ListOptions{Limit: 1}
pods, err := k.client.CoreV1().Pods(svc.Namespace).List(context.Background(), listOptions)
Could this issue be related to a network problem?
I'm wondering if the network latency or potential synchronization issues within the cluster might be causing this error. Any insights or suggestions would be greatly appreciated.
Remove this comment here
Line 6419 in ffee488
It gets propagated as description of the field Name
and it appears in descriptions of CRDs delivered to users.
As a suggestion, remove the comment and create an issue to address it.
Thanks 😄
kubectl uncordon my_node
translates to
PATCH /api/v1/nodes/my_node
{"spec":{"unschedulable":null}}
but current definition of core v1 NodeSpec.Unschedulable does not allow the field to be null. (bool type and json omitempty option).
And I don't know why but "unschedulable": false is ignored as well.
I'm continuously running into this error:
# k8s.io/api/core/v1
../../../k8s.io/api/core/v1/generated.pb.go:513:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/generated.pb.go:514:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/generated.pb.go:515:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/generated.pb.go:4177:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/generated.pb.go:4187:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/generated.pb.go:11017:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/generated.pb.go:13991:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/generated.pb.go:26053:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/zz_generated.deepcopy.go:2678:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/zz_generated.deepcopy.go:2693:6: invalid receiver type *List (List is an interface type)
../../../k8s.io/api/core/v1/zz_generated.deepcopy.go:2693:6: too many errors
metav1.List is an interface, you can't have a *List
. Why is this even a thing? What versions can I revert to to fix this?
Sorry, guys, maybe that's wrong place for question, but when will be release v0.21.0 approximately?
Hey folks! I noticed that my go.mod files always end up referencing the alpha version of the k8s.io/api, k8s.io/api-machinery and k8s.io/client-go modules, even when using go get
in a new project: go get k8s.io/api
: v0.28.0-alpha.0
, for example.
This occurs because the modules provide only "in-development" versions. I.e. versions with a major-version of 0
. https://go.dev/doc/modules/version-numbers#in-development
It's possible to reference one of the non-alpha versions but this works poorly with common upgrade flows: go get -u ./...
which push the version back to the alpha one. In other words, go get will change the manually set, non-alpha version back to the latest alpha version, because it's the latest.
Can you provide a v1
major version of these modules or is the API still unstable that it warrants remaining "in-development"?
When I was using ResourceQuotaStatus.Hard, I found a mistake. Hard
and Used
are ResourceList, but actually they are not.
When you define Hard
as a ResourceList, I can call methods of ResourceList
on it, So I can call ResourceQuota.Status.Hard.CPU()
for example, but it returns nothing because Hard
contains Limits
and Requests
like ResourceRequirements
type.
I know you define some constants for getting requests
and limits
from the Hard
's ResourceList
map(like ResourceRequestsCPU
).
Can you explain why you didn't use ResourceRequirements
as the type of the Hard
or Used
?
Can I fix it by changing types to ResourceRequirements
?
Why not add methods such as validate deployment?
I saw this method in kubernetes/pkg/apis/apps/validation/validation.go, I want to use it, but I can only copy one by one
../../../.go/src/k8s.io/kubernetes/pkg/api/v1/defaults.go:380: undefined: "k8s.io/api/core/v1".ScaleIOPersistentVolumeSource
../../../.go/src/k8s.io/kubernetes/pkg/api/v1/zz_generated.conversion.go:3172: undefined: "k8s.io/api/core/v1".ScaleIOPersistentVolumeSource
../../../.go/src/k8s.io/kubernetes/pkg/api/v1/zz_generated.conversion.go:4463: undefined: "k8s.io/api/core/v1".ScaleIOPersistentVolumeSource
../../../.go/src/k8s.io/kubernetes/pkg/api/v1/zz_generated.conversion.go:4478: undefined: "k8s.io/api/core/v1".ScaleIOPersistentVolumeSource
../../../.go/src/k8s.io/kubernetes/pkg/api/v1/zz_generated.conversion.go:4482: undefined: "k8s.io/api/core/v1".ScaleIOPersistentVolumeSource
../../../.go/src/k8s.io/kubernetes/pkg/api/v1/zz_generated.conversion.go:4497: undefined: "k8s.io/api/core/v1".ScaleIOPersistentVolumeSource
make[3]: *** [armada/armada] Error 2
Line 1829 in 4934d0c
// If specified, this must be an IANA_SVC_NAME and unique within the pod. Each
// named port in a pod must have a unique name. Name for the port that can be
// referred to by services.
// +optional
“Each named port in a pod must have a unique name ” is fix to "Each named port in a container must have a unique name"
This repo and other Go modules repos under kubernetes seem to be missing a tag for 1.20.0-rc.0 (https://github.com/kubernetes/kubernetes/releases/tag/v1.20.0-rc.0).
What happened:
I executed oc explain node
and received wrong information what a node is. It stated that a node is a worker node, which is wrong.
The information comes from: api/core/v1/types_swagger_doc_generated.go
"": "Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).",
What you expected to happen:
I expected it to write: a node is a worker node or a master node.
How to reproduce it (as minimally and precisely as possible):
oc explain node
Anything else we need to know?:
Open Shift Version from oc version
:
Environment:
RHEL 8.6, platform:el8
https://github.com/kubernetes/api/blob/master/core/v1/types.go#L2309
When you json.Marshal()
a ResourceFieldSelector
with undefined Divisor
, you get divisor: "0"
This is bad for 2 reasons:
omitempty
is meaningless hereDivisor
should default to 1
. Since it actually defaults to 0
, you get unintended behavior and incorrect resultsDivisor
instead should be a pointer *resource.Quantity
instead of just resource.Quantity
hi , I have some trouble about printing the audit log. In reality, this error blocks my goroutine
code form this
package main
import (
"fmt"
"k8s.io/api/apps/v1"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"net/http"
_ "net/http/pprof"
"time"
)
func main(){
service()
deployment()
if err := http.ListenAndServe(":6060", nil);err != nil {
fmt.Println(err)
}
}
func deployment(){
var a int32 = 1
deploy := &v1.Deployment{
ObjectMeta:metav1.ObjectMeta{
Name: "111",
Namespace: "222",
CreationTimestamp: metav1.Time{Time:time.Now()},
//DeletionTimestamp:&metav1.Time{Time:time.Now()},
Labels: map[string]string{
"app":"nginx",
"deploy":"helm",
},
},
Spec:v1.DeploymentSpec{
Replicas: &a,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"111":"222",
},
},
Template: apiv1.PodTemplateSpec{},
},
}
fmt.Println(fmt.Sprintln("%v",deploy))
}
func service(){
deploy := &apiv1.Service{
ObjectMeta:metav1.ObjectMeta{
Name: "111",
Namespace: "222",
CreationTimestamp: metav1.Time{Time:time.Now()},
Labels: map[string]string{
"app":"nginx",
"deploy":"helm",
},
},
}
fmt.Println(fmt.Sprintln("%v",deploy))
}
and error :
version
require (
k8s.io/api v0.22.2
k8s.io/apimachinery v0.22.2
)
Seems the repo hasn't synced for a week.
Dependabot is trying to upgrade my project with the following dependencies
k8s.io/api v0.28.0-alpha.4
k8s.io/apimachinery v0.28.0-alpha.4
k8s.io/client-go v0.28.0-alpha.4
However when I try to compile I get the following error
#14 [build 8/8] RUN go build -o /app/im-manager -ldflags "-s -w" ./cmd/serve
#14 31.08 # sigs.k8s.io/kustomize/kyaml/openapi
#14 31.08 /go/pkg/mod/sigs.k8s.io/kustomize/[email protected]/openapi/openapi.go:656:33: cannot use doc (variable of type *"github.com/google/gnostic/openapiv2".Document) as *"github.com/google/gnostic-models/openapiv2".Document value in argument to swagger.FromGnostic
#14 ERROR: process "/bin/sh -c go build -o /app/im-manager -ldflags \"-s -w\" ./cmd/serve" did not complete successfully: exit code: 1
The project in question can be found here.
Please let me know if I should add more information or ask in a different place.
I get this in the definition of WebhookClientConfig
, see here:
api/admissionregistration/v1beta1/types.go
Line 555 in 508b641
I'm confuse with the description, what's the mean of system trust
CA?
the one shipped with distros that include verisign and the other root CAs?
What about the CA of internal signer implemented in kubernetes? I mean CSR API of Kubernetes, is that CA a system trust roots on the apiserver
?
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.