Production-Grade Container Scheduling and Management
Go to file
Tim Hockin 73503a4936 Fix a small regression in Service updates
Prior to 1.22 a user could change NodePort values within a service
during an update, and the apiserver would allocate values for any that
were not specified.

Consider a YAML like:

```
apiVersion: v1
kind: Service
metadata:
  name: foo
spec:
  type: NodePort
  ports:
  - name: p
    port: 80
  - name: q
    port: 81
  selector:
    app: foo
```

When this is created, nodeport values will be allocated for each port.
Something like:

```
apiVersion: v1
kind: Service
metadata:
  name: foo
spec:
  clusterIP: 10.0.149.11
  type: NodePort
  ports:
  - name: p
    nodePort: 30872
    port: 80
    protocol: TCP
    targetPort: 9376
  - name: q
    nodePort: 31310
    port: 81
    protocol: TCP
    targetPort: 81
  selector:
    app: foo
```

If the user PUTs (kubectl replace) the original YAML, we would see that
`.nodePort = 0`, and allocate new ports.  This was ugly at best.

In 1.22 we fixed this to not allocate new values if we still had the old
values, but instead re-assign them.  Net new ports would still be seen
as `.nodePort = 0` and so new allocations would be made.

This broke a corner case as follows:

Prior to 1.22, the user could PUT this YAML:

```
apiVersion: v1
kind: Service
metadata:
  name: foo
spec:
  type: NodePort
  ports:
  - name: p
    nodePort: 31310 # note this is the `q` value
    port: 80
  - name: q
    # note this nodePort is not specified
    port: 81
  selector:
    app: foo
```

The `p` port would take the `q` port's value.  The `q` port would be
seen as `.nodePort = 0` and a new value allocated.  In 1.22 this results
in an error (duplicate value in `p` and `q`).

This is VERY minor but it is an API regression, which we try to avoid,
and the fix is not too horrible.

This commit adds more robust testing of this logic.
2021-08-30 12:42:17 -07:00
.github .github: update enhancement issue template to point to KEPs 2021-02-24 16:03:40 +05:30
api fix typo: Modify PodTrackingWithFinalizers to JobTrackingWithFinalizers 2021-08-23 15:38:30 +08:00
build Merge pull request #104586 from justaugustus/sig-release 2021-08-26 10:19:23 -07:00
CHANGELOG OWNERS(releng): Set reviewers to release-managers 2021-08-26 17:50:55 -04:00
cluster generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
cmd Merge pull request #95885 from jiahuif/refactor/controller-manager 2021-08-27 15:40:52 -07:00
docs hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
hack skip hack/tools/vendor folder 2021-08-26 20:02:43 +02:00
LICENSES Update cobra to v1.2.1 2021-08-18 15:02:25 -06:00
logo
pkg Fix a small regression in Service updates 2021-08-30 12:42:17 -07:00
plugin Merge pull request #103603 from mengjiao-liu/update-ingress-to-v1 2021-08-24 20:24:39 -07:00
staging Merge pull request #104630 from tkashem/remove-option 2021-08-28 05:32:52 -07:00
test Merge pull request #104455 from claudiubelu/test-images/windows-server-2022-part-2 2021-08-30 12:07:13 -07:00
third_party Copy golang license to staging copies 2021-08-10 17:37:28 -04:00
vendor Merge pull request #95885 from jiahuif/refactor/controller-manager 2021-08-27 15:40:52 -07:00
.generated_files
.gitattributes
.gitignore Rename _examples to examples 2021-01-25 10:20:46 -08:00
CHANGELOG.md
code-of-conduct.md
CONTRIBUTING.md
go.mod Merge pull request #104528 from kolyshkin/runc-1.0.2 2021-08-25 18:17:23 -07:00
go.sum Merge pull request #104528 from kolyshkin/runc-1.0.2 2021-08-25 18:17:23 -07:00
LICENSE
Makefile
Makefile.generated_files
OWNERS
OWNERS_ALIASES OWNERS(releng): Set reviewers to release-managers 2021-08-26 17:50:55 -04:00
README.md Update godoc reference widget to pkg.go.dev 2021-01-26 09:34:07 -05:00
SECURITY_CONTACTS
SUPPORT.md

Kubernetes (K8s)

GoPkg Widget CII Best Practices


Kubernetes, also known as K8s, is an open source system for managing containerized applications across multiple hosts. It provides basic mechanisms for 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.

Try our interactive tutorial.

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.
mkdir -p $GOPATH/src/k8s.io
cd $GOPATH/src/k8s.io
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.