Giter Site home page Giter Site logo

kubernetes / cloud-provider-gcp Goto Github PK

View Code? Open in Web Editor NEW
112.0 31.0 202.0 157.53 MB

cloud-provider-gcp contains several projects used to run Kubernetes in Google Cloud

License: Apache License 2.0

Go 63.21% Shell 28.26% Starlark 2.64% Dockerfile 0.06% Makefile 0.20% sed 0.05% PowerShell 5.59%
cloud-providers google google-cloud

cloud-provider-gcp's Introduction

Kubernetes (K8s)

CII Best Practices Go Report Card GitHub release (latest SemVer)


Kubernetes, also known as K8s, is an open source system for managing containerized applications across multiple hosts. It provides basic mechanisms for the deployment, maintenance, and scaling of applications.

Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale using a system called Borg, combined with best-of-breed ideas and practices from the community.

Kubernetes is hosted by the Cloud Native Computing Foundation (CNCF). If your company wants to help shape the evolution of technologies that are container-packaged, dynamically scheduled, and microservices-oriented, consider joining the CNCF. For details about who's involved and how Kubernetes plays a role, read the CNCF announcement.


To start using K8s

See our documentation on kubernetes.io.

Take a free course on Scalable Microservices with Kubernetes.

To use Kubernetes code as a library in other applications, see the list of published components. Use of the k8s.io/kubernetes module or k8s.io/kubernetes/... packages as libraries is not supported.

To start developing K8s

The community repository hosts all information about building Kubernetes from source, how to contribute code and documentation, who to contact about what, etc.

If you want to build Kubernetes right away there are two options:

You have a working Go environment.
git clone https://github.com/kubernetes/kubernetes
cd kubernetes
make
You have a working Docker environment.
git clone https://github.com/kubernetes/kubernetes
cd kubernetes
make quick-release

For the full story, head over to the developer's documentation.

Support

If you need support, start with the troubleshooting guide, and work your way through the process that we've outlined.

That said, if you have questions, reach out to us one way or another.

Community Meetings

The Calendar has the list of all the meetings in the Kubernetes community in a single location.

Adopters

The User Case Studies website has real-world use cases of organizations across industries that are deploying/migrating to Kubernetes.

Governance

Kubernetes project is governed by a framework of principles, values, policies and processes to help our community and constituents towards our shared goals.

The Kubernetes Community is the launching point for learning about how we organize ourselves.

The Kubernetes Steering community repo is used by the Kubernetes Steering Committee, which oversees governance of the Kubernetes project.

Roadmap

The Kubernetes Enhancements repo provides information about Kubernetes releases, as well as feature tracking and backlogs.

cloud-provider-gcp's People

Contributors

a-robinson avatar aojea avatar bowei avatar bprashanth avatar cheftako avatar cici37 avatar dangerontheranger avatar danielywong avatar freehan avatar hoskeri avatar ixdy avatar jpbetz avatar jprzychodzen avatar jsafrane avatar justinsb avatar k8s-ci-robot avatar kiranopensource avatar mikedanese avatar mrhohn avatar mrthinger avatar mskrocki avatar naveennathan avatar saad-ali avatar sambdavidson avatar shouri007 avatar sugangli avatar vinayakankugoyal avatar wyuan1704 avatar yujuhong avatar zmerlynn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloud-provider-gcp's Issues

Migrate seccomp annotation to API field in manifests

/kind deprecation

Seccomp (secure computing mode) support for Kubernetes has graduated to General Availability (GA). This feature can be used to increase the workload security by restricting the system calls for a Pod (applies to all containers) or individual containers.

seccomp.security.alpha.kubernetes.io/pod and container.seccomp.security.alpha.kubernetes.io/… annotations are now deprecated, and will be removed in Kubernetes v1.22.0. We should identify and transition workloads using the annotations to use the API fields before v1.21.

More resources:

The deprecated annotation is found in these files:

deploy/cloud-controller-manager.manifest
cluster/gce/manifests/glbc.manifest
cluster/gce/manifests/cluster-autoscaler.manifest
cluster/gce/manifests/kube-apiserver.manifest
cluster/gce/manifests/kube-controller-manager.manifest
cluster/gce/manifests/etcd-empty-dir-cleanup.yaml
cluster/gce/manifests/cloud-controller-manager.manifest
cluster/gce/manifests/kube-addon-manager.yaml
cluster/gce/manifests/kube-scheduler.manifest
cluster/gce/manifests/etcd.manifest
cluster/gce/manifests/konnectivity-server.yaml
cluster/addons/metrics-server/metrics-server-deployment.yaml
cluster/addons/metadata-agent/stackdriver/metadata-agent.yaml
cluster/addons/fluentd-elasticsearch/fluentd-es-ds.yaml
cluster/addons/fluentd-elasticsearch/kibana-deployment.yaml
cluster/addons/dns/kube-dns/kube-dns.yaml.in
cluster/addons/dns/kube-dns/kube-dns.yaml.base
cluster/addons/dns/kube-dns/kube-dns.yaml.sed
cluster/addons/dns/coredns/coredns.yaml.in
cluster/addons/dns/coredns/coredns.yaml.base
cluster/addons/dns/coredns/coredns.yaml.sed
cluster/addons/dashboard/dashboard-deployment.yaml
cluster/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml
cluster/addons/cluster-loadbalancing/glbc/default-svc-controller.yaml

Handle build tag `providerless` when extractions compeleted

providerless is a build directive specific to K/K. (See kubernetes/kubernetes#80353) It may make sense to keep it for now, as it may still be useful when we are vendored back into K/K but we should have an issue to clean this up once extraction completes. Also its worth being aware of as if we somehow inherit those build rules into this repo it will cause us problems.

Originally posted by @cheftako in #207 (comment)

Ref: https://github.com/kubernetes/enhancements/blob/master/keps/sig-cloud-provider/1179-building-without-in-tree-providers/README.md

Incorrect URL format for load balancers

When creating a load balancer, I get the next error from google API:

Error syncing load balancer: failed to ensure load balancer: failed to create forwarding rule for load balancer (a8811629b918a4c4d8da5705f41f4277(openshift-ingress/router-default)): googleapi: Error 400: Invalid value for field 'resource.target': 'https://compute.googleapis.com/compute/v1/**********************/regions/us-central1/targetPools/a8811629b918a4c4d8da5705f41f4277'. The URL is malformed. Must be a valid In-Project Target Proxy URL or a supported Google API bundle., invalid

This happens because of the change in Google API SDK that was added here with the version bump in #262:

❯ git diff de861a67f32828f69175d064c9847316b1731184~1..HEAD vendor/google.golang.org/api/compute/v1/compute-gen.go
diff --git a/vendor/google.golang.org/api/compute/v1/compute-gen.go b/vendor/google.golang.org/api/compute/v1/compute-gen.go
index a0213951..18c179dd 100644
--- a/vendor/google.golang.org/api/compute/v1/compute-gen.go
+++ b/vendor/google.golang.org/api/compute/v1/compute-gen.go
@@ -1,4 +1,4 @@
-// Copyright 2020 Google LLC.
+// Copyright 2021 Google LLC.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -78,11 +78,12 @@ var _ = internaloption.WithDefaultEndpoint
 const apiId = "compute:v1"
 const apiName = "compute"
 const apiVersion = "v1"
-const basePath = "https://compute.googleapis.com/compute/v1/projects/"
+const basePath = "https://compute.googleapis.com/compute/v1/"
+const mtlsBasePath = "https://compute.mtls.googleapis.com/compute/v1/"
 
 // OAuth2 scopes used by this API.

basePath has been changed, so targetPoolURL returns incorrect result: https://github.com/kubernetes/cloud-provider-gcp/blob/master/providers/gce/gce_loadbalancer_external.go#L635

run test jobs / gce-pd tests that're skipped in k/k due to CSIMigrationGCE

in K/K there're jobs that are skipped, either explicitly by adding Driver:.gcepd to the test skip, or implicitly by adding [[Feature:StorageProvider] or skipped if there is no default storage class installed.

In order to recover the lost testing coverage, we need to:

  • run them with clusters brought up by cloud-provider-gcp since they would have pdcsi drivers installed by default.
  • make sure that there's a default storage class installed for those clusters.

Here is a list of PRs that have test skipping:
kubernetes/kubernetes@2298dc6
kubernetes/test-infra#24330
kubernetes/test-infra#24425
kubernetes/kubernetes#106503
kubernetes/test-infra#23866
kubernetes/kubernetes#105052
kubernetes/test-infra#24438
kubernetes/test-infra#24490
kubernetes/test-infra#24695

kubernetes/test-infra#24625

"Forbidden" error code when using GCP CCM

A recent change #268 introduced IPv6 support, but it also began to require Google Cloud Compute Aplha API access. Unfortunately our CI doesn't have this access and therefore, when I start the CCM, it shows this error:

1 node_controller.go:241] Error getting instance metadata for node addresses: error while querying for providerID "gce://openshift-gce-devel-ci/us-central1-c/ci-op-l5l1d85s-8c513-m8pk7-master-2": googleapi: Error 403: Required 'Alpha Access' permission for 'Compute API', forbidden

More logs.

It would be nice to make the IPv6 support configurable and use GA Compute API when it's not enabled.

Add example/docs for using cloud-controller-manager

We are using k8s.gcr.io/cloud-controller-manager and looking to upgrade it with latest cloud-provider-gcp binary, but simply replacing the image does not work it required extra arguments but they are not documented anywhere.
I checked out the manifest template mentioned in bug #232 (it also mentioned adding docs) but here CRD type is pod whereas earlier it was deployed as a daemonset which raises more questions.

Can we please add ready to use manifest with examples and documentation around it to help people get started.

Migrate `cloud-provider-gcp` to use Lease API

/sig scalability
/sig api-machinery

Support for endpoints and configmaps is removed in K8s 1.24 with kubernetes/kubernetes#106852.
More details about the motivation to switch to leases - ref kubernetes/kubernetes#80289.

To preserve the backwards-compatibility, resource lock for migration purposes (endpointsleases, configmapsleases) should be used when switching from the legacy resource locks (endpoints, configmaps)

cloud-provider-gcp is currently using endpoints. We want to migrate this to endpointsleases and finally to leases.

CC - @wojtek-t

Create a SECURITY_CONTACTS file.

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

Unable to install GCP credential provider with 'go get' or 'go install'

Using go get getting following error


$ go get k8s.io/cloud-provider-gcp/cmd/auth-provider-gcp@latest
go get: k8s.io/cloud-provider-gcp@none updating to
	k8s.io/[email protected] requires
	k8s.io/cloud-provider-gcp/[email protected]: invalid version: unknown revision 000000000000

$ go get k8s.io/cloud-provider-gcp/cmd/auth-provider-gcp
go get: k8s.io/cloud-provider-gcp@none updating to
	k8s.io/[email protected] requires
	k8s.io/cloud-provider-gcp/[email protected]: invalid version: unknown revision 000000000000

$ go get k8s.io/cloud-provider-gcp/cmd/[email protected]
go get: k8s.io/cloud-provider-gcp@none updating to
	k8s.io/[email protected] requires
	k8s.io/cloud-provider-gcp/[email protected]: invalid version: unknown revision 000000000000

Using go install getting following error

$ go install  k8s.io/cloud-provider-gcp/cmd/auth-provider-gcp@latest
go install k8s.io/cloud-provider-gcp/cmd/auth-provider-gcp@latest: k8s.io/[email protected]
	The go.mod file for the module providing named packages contains one or
	more replace directives. It must not contain directives that would cause
	it to be interpreted differently than if it were the main module.

Migrate cluster changes between v1.18 & v1.19 from K/K to K/cloud-provider-gcp

K/cloud-provider-gcp cluster is a forklift of the version in K/K. It then has changes applied to it to support things like the KCM, CSI migration, ANP etc. It is necessary to keep applyingmerging the changes from K/K to K/cloud-provider-gcp.

The list of these changes can be computed using
git rev-list origin/release-1.18..origin/release-1.19 cluster/gce cluster/kube-up.sh cluster/common.sh cluster/kube-util.sh cluster/addons

Dependency checklist:

  • 93709423b49d40e7d2198a4e38ab8ff803c48eb3 (@cheftako)
  • 011ae24a46c65fa66f469c40cf85accb0b939438 ()
  • 29ce01657b5a7081fa80a0954b28de96b58b4435 ()
  • 7f0907c6e65915cd1c5fb0f6e2f95d996580d56f ()
  • bf9c2c900422ec7a42a966979f9b5bcb9a35f10e ()
  • 4d6fb49509d90a24561ea792b9a05aa67d96be79 ()
  • c6328b3425fbf1d3458e38a761235d2e8c8fe636 ()
  • 5f5b46a6e8ad5607a3eac4611ff23e3be7cbf561 ()
  • 88c1ac8bb102ea4fc1ab3f42d16dc33086d78f8b ()
  • 3226dafee1d184463710a6bbde910b4924262b39 ()
  • 47564331d36dcf494913857f556ea0acf1e4a8bc ()
  • aefa818cd422289ec969fa389657f6343635ca64 ()
  • b13898d6e92d27fa6725083d9d79426090b2b1a0 ()
  • 116465bb0429baf0160f6bc9c5d2feb279cb53a0 ()
  • 2e4a329b355e5968833104bacbeacae7ebcce466 ()
  • 247fcdfda5311bfc446c61c7bda67803e3527fdd ()
  • 99dd7570eb59a4ff040a7656c9d2b879f47acc59 ()
  • 90c223fa5cf0afa1144fbe35e50e212e0c6c9c7b ()
  • 402eea882d0614aa50a7189dcaad7dcec18e467d ()
  • 4804fbe4c157795769bfd9ec6ee021c5d98e76a7 ()
  • f9ad7db9a61d73411b2927707ec04bc25f7f4166 ()
  • 3b323b2ef08f33353973433de269f78751a20061 ()
  • 03509f3087f8b7d660cd689a04f8145764a3cd70 ()
  • 20032462850b87b8cf002bcffadbb4aaf02b2f26 ()
  • a2978e3ddb1ce167366536aab312a25ca7d22d5d ()
  • 15bf1b1630b0b44dc4f37aa2bef98b29fe73e21c ()
  • 29cdaad79e3d88810a8cd049105e49d4a194ba41 ()
  • e07f2a6b1da8f370f2d5e326f9f2a5ad7401ac85 ()
  • e9bf1c3c901ccd708ad6b3ded48b64a35619c830 ()
  • c430183fffc5ba15c9baaaa021fc507053cb5cf4 ()
  • dbf6c456a29589eba5bc2f96c08d558dcf6b5f85 ()
  • eee27e8f4442d55b6fde08cdbca09b143615195b ()
  • adf2cd40ae67c137371d817ab72f1dd274165ef5 ()
  • 61342e398e459c883d3c9de287acb6c3530a8b86 ()
  • 57d0dc540d16a4e72076e10fdf8e0bcaebb9f335 ()
  • adffc7fccac0152463ca1482700aa6bc77a174b8 ()
  • f86b720cf619fed82342ac81c1ae7f460e927460 ()
  • 902a4db5fcb904a97e183451cefaedfc6a4a37bd ()
  • 12bced9bfba3a0f37a2924cdf422bafabdb3a3e7 ()
  • 908847c01e9640ffce2ffda5acf88d92c48a5148 ()
  • 6257f83f8889fad406eba49e674317776f182d5a ()
  • de491f11b1d982c98ef7fdf9168b510e6822976d ()
  • a653c21479c1dc84b41ec855de664ddae92f5e87 ()
  • 1b13308edb25e580fb188377e308fea4db56faf0 ()
  • a36aa9c31efdb82f2baf507ef1dde48cf0bd1c9c ()
  • 4a91ecb9762adc089680c45c93d0342bf8a350e1 ()
  • c39cf28ed35200bd9b20ee1408edef73cd3ab7e6 ()
  • ca372d3ca5ca67758f3ee57d798b26cea6b648ee ()
  • c3a6a66592b3a779a4cb05eba3c465690841601b ()
  • 2d7c47d2be5364679763dbfdd1867586828822a9 ()
  • 2f7874bd4bc1341256b73fcac885356ee6938657 ()
  • db9d6d0bffc8a3bc3fc1f4476e1b3a44c1e82983 ()
  • 31ae200ebf31659975ea1cbdee75dc7e1b08b54d ()
  • d140769e4d26f3a175d8a59782ea63595a9f4899 ()
  • 4c8207dc1e43f076692fa9ad97a67df07e6db56a ()
  • c6011f2d54149c130b2ab0107aa065ca8cc16ee4 ()
  • 9714f3ac862a3f9cb78396564ce76379e128f909 ()
  • 2d1c417934c07da9e144749dae26448d7da3f615 ()
  • 4369eb315544be4eaa0ba7e25d991635e69f58e1 ()
  • 87e6ec493c9c10c0267e7da8f57d162d98c99821 ()
  • 60bd17a61f7b93e0617713d69f897a1b2563624b ()
  • bfa6eb1772cdcc5acbc4e02e0f8712b068320602 ()
  • 0da9c3e3793a53610372e5dc6cca2786865f271c ()
  • 6bb668c3c40fc59b1d539fd1629d13831f559fdd ()
  • c83c4d545387997466f08ca134d6833453882c95 ()
  • 27658f82411d7113f39f770b9d39d5f505231ee2 ()
  • 06d034f3c8c5cd6fc20026de59d8dae536673b75 ()
  • 1f629ca4a212703c1922bfbc8683f8a8238d568c ()
  • 51aac92f69a2c2e30e7b0cfea067a8fdfd13585d ()
  • 01183e51f084b1a05420f743bca3011b3925a084 ()
  • fbb4bb00039df4be4ac647b30d74aabdf2e12b3e ()
  • 0a1e58913c5f9cbfe0fe46d11d48e6968b7ce11d ()
  • b0af921e80f809bc4c85e382e02e8c7b879e0761 ()
  • 0239a7d85779a9cbbf4ceb81ecfdee927aa05ecf ()
  • 3958ecb5c7308422fbf963ce496f89f506cd90da ()
  • 55242bf3c9542810d05cbe9454027b789fb348df ()
  • 29f96dfa2db789e3a2606cafba76d50154a79eab ()
  • 79960095dd5a84ae2d397301139d8fbbdeaac540 ()
  • 953597134babf68ad6eb40d497631ced28366033 ()
  • c6b2b1fad330afcbbe2a005a14d959457b6f54b4 ()
  • eff58cc003b59747a26e2198bb21396956b25483 ()
  • c5ef7ee9975f23464085907a7063628630f3fdc6 ()
  • e4215752435cd9f6a4ffefc159bd0722133eeb91 ()
  • 06e3aeccc49b8fa0cbd758eeb39fcacd5e8d47ce ()
  • c84eb123573095c5bb51729cfa1d530e5190f715 ()
  • 66015ff654ba8e0b3ffb590a6b3cc86a85022c61 ()
  • ac5ec4aa809bb4c4820a6556507c0c63f0e61c5b ()
  • 1731cb30f540d386147f9e89b989e9753aa9daa3 ()
  • db152fdd7d9938fc9f8d637b6853a56f12ce33a4 ()
  • 3509b46fc6fe2bb5ee3ab9cdca0c3e4f93025042 ()
  • 5de465e67deae02cf16cf3e50255776c98b18516 ()
  • 65821acd8786f247c947e5e22209ec9370079b79 ()
  • ee27e5b8be630e4e2135b7004045d8b5be51d19e ()
  • 2dc408abb38af2301b1c6a5f5c57bd7414fadba1 ()
  • c0455a18531aec2af0f4a879a0364b40c2e19a59 ()
  • 0a4f3f64a725318e3cca9064fc4f25917dc053c2 ()
  • b1f4bfb03e6a40db9e119e75eac10a1f9f523bbf ()
  • 8daa9e6f7749a622b9e0006ddffd0242c6abebce ()
  • 3336d59ab2994f245bc2d2a988dd27cd75d3f4c2 ()
  • c5444496d5f7eaec5ef1a5988de549875604f061 ()
  • 7433364bb4d0cf36d6b411e963688a7766973537 ()
  • d2fc2d282d7712dc17a6e922a61cd835cc934e21 ()
  • 5d93888f206fffa6789ed7c9440607fcd2380086 ()
  • e5af792ad29fdbd8f401b5d0d78e8fb0d64c1fe6 ()
  • c1707541d8430716477f2dfa163ef9f9cdcbe9ba ()
  • bc06f367d425fd69f9ff75a6624ad55f706ac878 ()
  • f91c1ef60e808ed4070619e0f7c53849757cf26c ()
  • 10f300313e53bff9932ce7b0b10bb14196fb43bd ()
  • b1bd5113d4142b2780f69fd933df1cfba9375cb5 ()
  • f01d848c4808bdaaa1378511c343a63a650f8cf1 ()
  • b692502a9d55105ca412eb4f619b74b41fa01225 ()
  • 10caa46f6bfc98b4e184472880ad21126515c04d ()
  • 9e06faa1fbf473107de53b1a4d9e731d2b4eaa1e ()
  • b1742f19efb8ed300c1acc968c87b69c3801f42f ()
  • bd835d8a1c00a9eb0eb694eff9203f5224c11fc8 ()
  • a49da364eb75a1837ef7f7acc5a0c3d37aaea33d ()
  • c97c61ebe8eb35a7446d6997791a9d30ccb0fb9e ()
  • 52358fe010efb345c14dffb871545f5796e162cf ()
  • 2f883e5802111c20a535254fc235300cfb1870c8 ()
  • 20b37d6c5a8ce4bb95c5095bceeac096e5041ced ()
  • 451592c6a5e6ef0aeb3fcd344d31925abbb4cc0d ()
  • 57caa27b8dd7ecdcd520ac6ed4ea382c27745a85 ()
  • 15e491eb2f98c29a94847d52f0a65269dd86d5e1 ()
  • cf13f8d994a4c79dd84440918f146db3c51abc62 ()
  • b5eb3831c3ea1fa3ad192ed02e091dfae0330bac ()
  • e71acffdfe7229d203e11a4ef423e21c536c0be2 ()
  • 5c966e3bebbefaee2c5a4d91343a63d66d3bf0a8 ()
  • 3c5585bfd9bee50922a5d0c47ef770b8439f6192 ()
  • ce1840d25317304765967a0580404935fe011860 ()
  • 1e2ddd12616064ea406757f58efa4a9a087f4f1d ()
  • e215a8772c37a3ddce237a44d774304c05787cfd ()
  • 5ec2ff2d2009c2838a1b1511f5073ea2aa943ccd ()
  • 4b3e023659d5437d5ea611e9e14295d1143385d8 ()
  • 07d88617e55b64c243956c7b2032430beb03b159 ()
  • 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5 ()
  • 9d3406c27b581c0961ac5871f6893f838d59b10c ()
  • 950ed38996cd530154732b37483afa1ad79ad8d7 ()
  • f2c22addf551008102ed5e2162c6aff51e00f54f ()
  • e6433bd76b181406b966e7a995f295e8e6ea6009 ()
  • fdef0a6767223aca72de25ff1577ed5904505bfa ()
  • d826b4b05c37c38c5af6177271ffe1de71dd2c56 ()
  • b8be11e3fc1c67ec015deaeb6e03c22bdf12205c ()
  • ca90cf60490fbb3d9d177594422fc1799d32b821 ()
  • d681a04541aba5fc7a8c334631eb89eb70a42644 ()
  • 1ea97db78ab289e04669b7579551bdec3e74c0bc ()
  • 1aa67fc525bc28a236a97e433b54a58dd2f0365d ()
  • 785aadca7f5e3b244506795ec6561e0074829c8c ()
  • 7d53ecee37ceba888edb451e6bce98e57dab3982 ()
  • 325ea6e3c2a09aaa27425dbb2227e1b73d98f84c ()
  • 9213616a230641777047f2297813043ecaa60456 ()
  • 339918d2067360932fa35c066b9fa335593d5dc7 ()
  • 14eb29108470072edbcaf28fb72754fb40a793e9 ()
  • 27f06962d84868be93ead72d0f14eb5922020c4d ()
  • eb6ee368b9aae7c3c464d4574056961216668b3a ()
  • 069381edec454f7e9037d3c8eb4de15ec25a95bb ()
  • aaa0d12cc7429c4772268f4d41ffb172f89ba665 ()
  • 0d38f219328bc128b2c9d0d58625a179ce6ddb14 ()
  • 15d6c9a5eaab2c7ae65b37e1bb2da599971d082a ()
  • c71a25e91209714463664474428ab10dfc1ad6e3 ()
  • 9684c13fba818e533cdc9c0e1415a794bebd1d31 ()
  • 7229e13036e4c89c5b4977ec968229a214ce2d0c ()
  • 20d44dfbfef988ac8058e90138941514d9c0c1b4 ()
  • e494b0788b02d954418ee3a37a9ead77fa807ef3 ()
  • c0387ab3ac41bfd756b2c316d25298989539f6bf ()
  • 53374fa519c7c4725fea0da39d9cc6d475c16e74 ()
  • 1bcd49d5cdbdad9a17de43fe5bc6b5d044f4f925 ()
  • 820c87c0695a113cb174c4f8eec2c73ed0cd3e5b ()
  • a01b1dada5f2e7eb5a308aa069571b9e96af039b ()
  • 7a5f4c47de4224b3dbcab0c3713c55b510f7f1a9 ()
  • 3b00d7dce51b3833815e2459e3a92ed917402170 ()
  • aed3f054953ef28174930ce9c540f5c2b003ae78 ()
  • 3e4744c7364808e6a78b4f92bff30692a0abc179 ()
  • ea2d784545330a061245c4667b1d01f2a1faa3ab ()
  • 394df132bd41b3deb0dbeccfdd4a9df9e0c6729c ()
  • c0be582ca5bea9711275ca45c6c6ad4466bc3927 ()
  • 21bef7536c2d608778840a90a520d064e639d97e ()
  • 5534c12dadbf1e9c7fab723c38bf0713db976804 ()
  • 4ae223fbff3dc0fa3a569ca579a147a3bc0f6f8a ()
  • fa6b9bec81d90d1e9e100264f00a16bca6ce7803 ()
  • 81a0e2f62b50bf616afd334b778657a7e589cb46 ()
  • 9639464e430d5510308eb71cfae372146b4d4061 ()
  • 31393df6eed6b18a85bb6cc6f5474541a14e2151 ()
  • 6a552da932c02e4885cf1fbb3fa248c2ed1ca282 ()
  • 52653195f65de0fdd9cb14619841ff636ad85887 ()
  • 72f58ae4ff6b0183292767e86f6627c8f76bb29d ()
  • 24d8a17f7045e1d0671fa010ba1462ce689809d3 ()
  • c7abf44a197867234c5f3732267354ce41dc2783 ()
  • 55df85ba3750cf6b90db6e18d338295f49f0f76f ()
  • 35838161127449d1517bd0e27654ed8ab00df4d8 ()
  • 08ce946e09e38a7a789dc0e0ff7aab3d8f9498e6 ()
  • a9f6b93b62a98598913180c640ab044c85a6718b ()
  • 295b53f7b43491015be2b5ebcdc08909ae3da584 ()
  • c70cd1e82fa7c8e2f0fbc647191fb349380916dd ()
  • 58f78a53ee1afdc6f656d2517275e52bda34c865 ()
  • 335bfe091131ea1024351095d8437772d02ff2d6 ()
  • de877ec26e2e3e5464b66bbb6734b5b09c4e455b ()
  • 2ede416104a90549a625d061e4ad6a17db3d0487 ()
  • 33810a99d9fe0ea7beb7eea2cd2a7f5bc688d2bb ()
  • 50c082785657e9d45507635369b95862b3ebaafa ()
  • c6fa1391f51dfe56268eef2eec9c59620d444b09 ()
  • f48268d13bd8b3cb6298a037e09b490a436c00e7 ()
  • 936f7665cf114898554e89859cd637bafd399231 ()
  • 5de3c64ad0e9199bb08846a7aa00e8b2499b5083 ()
  • f899ad704ae6bd87560a3e21b9cfbb8bdeef404e ()
  • 1a334335bc12ddeac8db8b573910775e541870c7 ()
  • f9e0e4c6b42105cf45be5d6ba2844402099ab089 ()
  • fbbe9bba8c620a47cd59f11445f21dd6753ad67f ()
  • 8055c92e26d0c1f278804ce66906a7115848d5d7 ()
  • a6f209c1c038dce7256e1cf115ed393ec22fbb9e ()
  • 02915ef1797681d2f51019a46989e9ec597d294a ()
  • df292749c9d063b06861d0f4f1741c37b815a2fa ()
  • 5ce41981526a3d2d5a41290b45181f7cabaabf68 ()
  • adc59271d380b57f553812392bc62f493d1e6f50 ()
  • a6739dbffc76b0b6cd8000fa45c02c2945f2889c ()
  • ba74c1cfb43df68f1472c12f91dc90e1eeb89da4 ()
  • 5463eda704c0229799f109ca5bc8e0c09184025a ()
  • a2efefc8209c9379763dd44c62e459d195038296 ()

Update go version

Since k/k has been updated to go1.15 in v1.19, go1.16 in v1.21, better to keep cloud-provider-gcp synced.

Are all failures merely temporary bumps in the road?

The logic for temporaryError is suspicious:

// temporaryError is used within validators to decide between hard-deny and
// temporary inability to validate.
type temporaryError error

if _, ok := err.(temporaryError); ok {
return false, fmt.Errorf("fetching EK public key from API: %v", err)
}
klog.Infof("deny CSR %q: fetching EK public key from API: %v", csr.Name, err)
return false, nil

Because these are interfaces (not structs), I believe all errors will implement temporaryError:
https://play.golang.org/p/ZLq4FoS6vc8

I think we need temporaryError to be a struct.

cloud-provider-gcp-e2e-create is failing

Failing run

Most recent passing run

The only difference I see is a change in the kubekins-e2e image: v20200802-ff98b58-master vs v20200726-f8d6253-master

The error:

+ make install
/home/prow/go/src/k8s.io/kubetest2/hack/go_container.sh go build -v -o /out/kubetest2 .
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I don't see the docker socket anywhere in the volume mounts for either the passing or failing run, so I'm really not sure how this worked to begin with.

Nodes network-unavailable taint not removed after installing ccm

After installing ccm the node.kubernetes.io/network-unavailable taint is added if --configure-cloud-routes=false is set to false. Here's the args used to initialize the ccm

args:
    - --bind-address=127.0.0.1
    - --cloud-provider=gce
    - --use-service-account-credentials
    - --configure-cloud-routes=false
    - --allocate-node-cidrs=true
    - --cluster-cidr=10.244.0.0/16

RBAC lacks cluster-id ConfigMap permissions

and I can't determine whether it is intentional.

Looking at the implementation, it seems like there is a clear need for a CREATE permission on configmap resources. Unfortunately, Role manifest lacks this permissions. This leads to:

E1028 13:43:43.000801       1 gce_clusterid.go:201] GCE cloud provider failed to create kube-system/ingress-uid config map to store cluster id: configmaps is forbidden: User "system:serviceaccount:d8-cloud-provider-gcp:cloud-controller-manager" cannot create resource "configmaps" in API group "" in the namespace "kube-system"

Cut a release for K8s 1.23

What would you like to be added:
Please cut a release for use with Kubernetes 1.23.

Why is this needed:
Kubernetes 1.23.0 has been released. Users should have a fixed tag for pulling a corresponding GCP CCM.

/kind feature
/sig cloud-provider
/priority important-soon

Support `--account` option for `gke-gcloud-auth-plugin`

The gke-gcloud-auth-plugin plugin doesn't allow to inject custom gcloud params, like --account option:

return executeCommand("gcloud", "config", "config-helper", "--format=json")

Account name option was so far - at lest for me - a very useful way to work with multiple user identities handled by one .kube/config file. Otherwise, every time before running kubectl against some some cluster, I'd need to run gcloud config set account ... (to make sure the the token will be generated properly).

Is there a way to expose it as a separate param? Or maybe a set of additional params to be passed to the underlying gcloud call?

Fix support on case-insensitive filesystems

cloud-provider-gcp has a BUILD file in its project root alongside a build directory. This causes issues on case-insensitive filesystems like on MacOS.

For example, a fresh git clone:

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    BUILD

no changes added to commit (use "git add" and/or "git commit -a")

and a dep init in a project that includes k8s.io/cloud-provider-gcp:

$ dep init
init failed: unable to solve the dependency graph: Solving failure:
	(1) failed to clean up git repository at /gopath/pkg/dep/sources/https---github.com-kubernetes-cloud--provider--gcp - dirty? corrupted? status output:
 D build/BUILD

Would it be possible to fix this? perhaps renaming the build directory.

Break up gcp-controller-managed into logical packages

Right now it's:

  • minimal package main
  • package app that has ~everything

Proposed structure:

  • minimal main
  • pkg/controller
  • pkg/controller/csrapprover
  • pkg/controller/csrsigner
  • pkg/controller/nodeannotator
  • pkg/cacache

go mod tidy returns an error about a broken link for https://knative.dev/eventing-contrib

After a recent update of API, when I try to execute go mod tidy on a freshly cloned repo, I see this error:
❯ go mod tidy
go: sigs.k8s.io/[email protected] requires
sigs.k8s.io/[email protected] requires
k8s.io/[email protected] requires
github.com/tektoncd/[email protected] requires
knative.dev/[email protected]: unrecognized import path "knative.dev/eventing-contrib": reading https://knative.dev/eventing-contrib?go-get=1: 404 Not Found

tests in provider/gce can fail due to missing test dependencies

Example test failure for #204 : https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/cloud-provider-gcp/204/cloud-provider-gcp-tests/1387458716499972096/build-log.txt

The problem here seems to be related to the fact that there are now two modules in cloud-provider-gcp:

  • root module
  • module under providers/gcp

The failing test command is:

bazel test --test_output=errors -- //... -//vendor/...

This command runs the unit tests of the provider/gcp module as well as the unit tests of the root module. It fails when it can't find the k8s.io/cloud-provider/credentialconfig package that the providers/gce/gcpcredential package depends on.

k8s.io/cloud-provider/credentialconfig is missing because when go mod vendor is run on the root module, it decides not to include credentialconfig into the vendor directory. go mod vendor believes it can safely omit the credentialconfig directory because there are no non-test build dependencies on it . There is a test dependency on it, but only from the provider/gcp module which go mod vendor assumes it doesn't need to satisfy, because it sees it as just another vendored in dependency (golang/go#34435 (comment)). This is no unreasonable because go mod vendor has no way to know that we set up a symlink from vendor/k8s.io/cloud-provider-gcp/providers to provider/gcp and treat what it considers to be a vendored in dependency as source code that we need to test.

k8s/k8s presumably has a similar problem with the staging repos. I know that in k8s/k8s go test doesn't work on staging repos when run from the root. I'm less familiar with how bazel test works for staging (if anyone knows, please feel free to explain).

Possible solution: Replace bazel test --test_output=errors -- //... -//vendor/... with one test command that only tests the root module and another that tests the provider/gcp in a way that works--maybe just don't use the vendor directory for the provider/gcp module testing?

Documentation

Hey folks,

Apologies if this is not the place to ask this, but I couldn't find any documentation regarding using this controller on gce.

The k8s documentation is very broad and cloud agnostic. Any help/suggestions?

GCP Credential provider not returning valid cache key type

While trying to use the GCP image credential provider plugin getting errors in the kubelet logs
credential provider plugin did not return a valid cacheKeyType: ""

Not sure but on digging some code, it is not returning any value for cacheKeyType
https://github.com/kubernetes/cloud-provider-gcp/blob/master/cmd/auth-provider-gcp/provider/provider.go#L84

cacheKeyType is required to be specified by plugin as per the API https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/kubelet/pkg/apis/credentialprovider/types.go#L64

Cannot build on darwin_amd64

Operating system: macOS Catalina 10.15.1

Steps to reproduce:

  1. Close the repository
$ mkdir -p ~/go/src/github.com/kubernetes
$ cd ~/go/src/github.com/kubernetes
$ git clone [email protected]:kubernetes/cloud-provider-gcp.git
$ cd cloud-provider-gcp
  1. Install bazel
$ bazel --version
bazel 1.2.1
  1. Ensure that the publish fails
$ IMAGE_REPO=foo/gcp-controller-manager IMAGE_TAG=v1 bazel run //cmd/gcp-controller-manager:publish
Starting local Bazel server and connecting to it...
INFO: Call stack for the definition of repository 'go_sdk' which is a _go_download_sdk (rule definition at /private/var/tmp/_bazel_me/63495b22c22bd0073891a0528125c5f7/external/io_bazel_rules_go/go/private/sdk.bzl:80:20):
 - /private/var/tmp/_bazel_me/63495b22c22bd0073891a0528125c5f7/external/io_bazel_rules_go/go/private/sdk.bzl:93:5
 - /Users/me/go/src/github.com/kubernetes/cloud-provider-gcp/WORKSPACE:45:1
ERROR: An error occurred during the fetch of repository 'go_sdk':
   unsupported platform darwin_amd64
ERROR: While resolving toolchains for target //cmd/gcp-controller-manager:publish: invalid registered toolchain '@go_sdk//:go_android_amd64': no such package '@go_sdk//': unsupported platform darwin_amd64
ERROR: Analysis of target '//cmd/gcp-controller-manager:publish' failed; build aborted: invalid registered toolchain '@go_sdk//:go_android_amd64': no such package '@go_sdk//': unsupported platform darwin_amd64
INFO: Elapsed time: 7.203s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (6 packages loaded, 6 targets configured)
FAILED: Build did NOT complete successfully (6 packages loaded, 6 targets configured)
    currently loading: @bazel_tools//tools/jdk
    Fetching @local_config_cc_toolchains; Restarting.
    Fetching @rules_java; fetching
    Fetching @rules_cc; fetching

the logic checking whether instance belongs to cluster needs to handle errors better

We hit situation when a single nodepool issue (IGM was deleted and got stuck in this state) caused this logic to fail:

func clusterHasInstance(ctx *controllerContext, instanceZone string, instanceID uint64) (bool, error) {
// instanceZone looks like
// "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c"
// Convert it to just "us-central1-c".
instanceZone = path.Base(instanceZone)
clusterName := fmt.Sprintf("projects/%s/locations/%s/clusters/%s", ctx.gcpCfg.ProjectID, ctx.gcpCfg.Location, ctx.gcpCfg.ClusterName)
recordMetric := csrmetrics.OutboundRPCStartRecorder("container.ProjectsLocationsClustersService.Get")
cluster, err := container.NewProjectsLocationsClustersService(ctx.gcpCfg.Container).Get(clusterName).Do()
if err != nil {
recordMetric(csrmetrics.OutboundRPCStatusError)
return false, fmt.Errorf("fetching cluster info: %v", err)
}
recordMetric(csrmetrics.OutboundRPCStatusOK)
for _, np := range cluster.NodePools {
for _, ig := range np.InstanceGroupUrls {
igName, igLocation, err := parseInstanceGroupURL(ig)
if err != nil {
return false, err
}
// InstanceGroups can be regional, igLocation can be either region
// or a zone. Match them to instanceZone by prefix to cover both.
if !strings.HasPrefix(instanceZone, igLocation) {
klog.V(2).Infof("instance group %q is in zone/region %q, node sending the CSR is in %q; skipping instance group", ig, igLocation, instanceZone)
continue
}
// Note: use igLocation here instead of instanceZone.
// InstanceGroups can be regional, instances are always zonal.
ok, err := groupHasInstance(ctx, igLocation, igName, instanceID)
if err != nil {
return false, fmt.Errorf("checking that group %q contains instance %v: %v", igName, instanceID, err)
}
if ok {
return true, nil
}
}
}
return false, nil
}

Sync node-csr-<redacted> failed with : validating CSR "node-csr-<redacted>": checking VM membership in cluster: checking that group "<redacted>" contains instance <redacted>: googleapi: Error 404: The resource 'projects/<redacted>/zones/us-west1-b/instanceGroupManagers/<redacted>' was not found, notFound

Ideally the error handling logic in the function should skip errors and only fail with error if instance is not found in any of node pools.

cloud-provider-gcp prow jobs should use same version as in go.mod

prow uses go 1.17
go.mod has 1.16

Having the go.mod files use 1.16 while prow uses 1.17 resulted in gofmt expecting files to be formatted differently (go 1.17 introduced "go:build" tags).

There are two parts to this:

  • we should probably bump to 1.17 now
  • I'd like prow and go.mod to stay in sync if at all possible

Dual-stack support for LoadBalancer k8s services

Are there any plans to support dual-stack for LoadBalancer k8s services?

I have not found any docs clearly stating dual-stack support for GCP network load-balancers, so not sure whether it is even possible ATM. Just wondering if there are any plans on this?

Remove copied credential provider code once relevant PRs merge

In order for #168 to not depend on any k/k-private code, some packages had to be copied out from other PRs. Those packages are:

E2E testing for credential provider

The provider has a unit test suite but could use some work on the E2E side. It should be integrated with the new E2E test that cloud-provider-gcp has (cloud-provider-gcp-e2e-full), so either integration with the rest of the kubetest2 suite or modifying the presubmit itself will likely be necessary, I believe. The actual test itself should at least involve bringing up a cluster with the provider enabled, but testing error handling (attempting to fetch credentials on an image that doesn't exist, etc.) would be good, as well.

Enable Functionality to Support a Shared-VPC Model

Hi All,

We are running a K8s Cluster in GCP deployed using Pivotal Container Service 1.6.1.

The current architecture is defined using a Shared-VPC Model inside of GCP. The vpc-network is configured in the Host project and the cluster is configured in the Service project.

After provisioning the cluster and deploying a Service of type LoadBalancer, it fails to actually provision a resource inside of GCP with the following:

Error syncing load balancer: failed to ensure load balancer: googleapi: Error 404: The resource 'projects/<my-project-id>/global/networks/<my-network-id>' was not found

Where <my-project-id> is the Service Project (this is where we want our Resources to be provisioned) and <my-network-id> is the Host Project (this is where the VPC lives and is shared to <my-project-id>)

We've tried to define the full Project ID of both the Host and Service projects, however it seems that it is unable to differentiate between the projects.

Given that there are many users who use this Shared-VPC model, I assumed that this functionality already exists inside of the provider. Is this a true statement?

If so, can someone guide us in the right direction on how to properly specify the project/vpc-network IDs? If not, could this feature be implemented?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.