2017-03-16 23:50:19 +00:00
|
|
|
---
|
2018-02-27 18:51:46 +00:00
|
|
|
reviewers:
|
2017-03-16 23:50:19 +00:00
|
|
|
- caesarxuchao
|
|
|
|
- lavalamp
|
|
|
|
- thockin
|
|
|
|
title: Connecting Applications with Services
|
2021-12-08 18:50:01 +00:00
|
|
|
content_type: tutorial
|
|
|
|
weight: 20
|
2017-03-16 23:50:19 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
|
2020-05-30 19:10:23 +00:00
|
|
|
<!-- overview -->
|
2018-06-11 19:38:26 +00:00
|
|
|
|
2017-03-16 23:50:19 +00:00
|
|
|
## The Kubernetes model for connecting containers
|
|
|
|
|
2022-01-10 22:57:50 +00:00
|
|
|
Now that you have a continuously running, replicated application you can expose it on a network.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
Kubernetes assumes that pods can communicate with other pods, regardless of which host they land on.
|
|
|
|
Kubernetes gives every pod its own cluster-private IP address, so you do not need to explicitly
|
|
|
|
create links between pods or map container ports to host ports. This means that containers within
|
|
|
|
a Pod can all reach each other's ports on localhost, and all pods in a cluster can see each other
|
|
|
|
without NAT. The rest of this document elaborates on how you can run reliable services on such a
|
|
|
|
networking model.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2021-12-08 18:50:01 +00:00
|
|
|
This tutorial uses a simple nginx web server to demonstrate the concept.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2020-05-30 19:10:23 +00:00
|
|
|
<!-- body -->
|
2018-06-11 19:38:26 +00:00
|
|
|
|
2017-03-16 23:50:19 +00:00
|
|
|
## Exposing pods to the cluster
|
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
We did this in a previous example, but let's do it once again and focus on the networking perspective.
|
|
|
|
Create an nginx Pod, and note that it has a container port specification:
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
{{< codenew file="service/networking/run-my-nginx.yaml" >}}
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
This makes it accessible from any node in your cluster. Check the nodes the Pod is running on:
|
2017-08-11 18:02:45 +00:00
|
|
|
|
2017-03-16 23:50:19 +00:00
|
|
|
```shell
|
Official 1.14 Release Docs (#13174)
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S. (#11752)
* Added documentation about Poseidon-Firmament scheduler
* Fixed some style issues.
* Udpated the document as per the review comments.
* Fixed some typos and updated the document
* Updated the document as per the review comments.
* Document timeout attribute for kms-plugin. (#12158)
See 72540.
* Official documentation on Poseidon/Firmament, a new multi-scheduler (#12343)
* Removed the old version of the Poseidon documentation. Incorrect location.
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S (#12069)
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S. (#11752)
* Added documentation about Poseidon-Firmament scheduler
* Fixed some style issues.
* Udpated the document as per the review comments.
* Fixed some typos and updated the document
* Updated the document as per the review comments.
* Updated the document as per review comments. Added config details.
* Updated the document as per the latest review comments. Fixed nits
* Made changes as per latest suggestions.
* Some more changes added.
* Updated as per suggestions.
* Changed the release process section.
* SIG Docs edits
Small edits to match style guidelines.
* add plus to feature state
* capitalization
* revert feature state shortcode
since this is a Kubernetes extension, not a direct feature, it shouldn't use the regular feature state tagging.
(cherry picked from commit 7730c1540b637be74b9b21d4128a145994eb19cc)
* Remove initializers from doc. It will be removed in 1.14 (#12331)
* kubeadm: Document CRI auto detection functionality (#12462)
Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
* Minor doc change for GAing Pod DNS Config (#12514)
* Graduate ExpandInUsePersistentVolumes feature to beta (#10574)
* Rename 2018-11-07-grpc-load-balancing-with-linkerd.md.md file (#12594)
* Add dynamic percentage of node scoring to user docs (#12235)
* Add dynamic percentage of node scoring to user docs
* addressed review comments
* delete special symbol (#12445)
* Update documentation for VolumeSubpathEnvExpansion (#11843)
* Update documentation for VolumeSubpathEnvExpansion
* Address comments - improve descriptions
* Graduate Pod Priority and Preemption to GA (#12428)
* Added Instana links to the documentation (#12977)
* Added link to the Instana Kubernetes integration
* Added Instana link for services section
Added Instana and a link to the Kubernetes integration to the analytics services section and broadened the scope to APM, monitoring and analytics.
* Oxford comma /flex
* More Oxford commas, because they matter
* Update kubectl plugins to stable (#12847)
* documentation for CSI topology beta (#12889)
* Document changes to default RBAC discovery ClusterRole(Binding)s (#12888)
* Document changes to default RBAC discovery ClusterRole(Binding)s
Documentation for https://github.com/kubernetes/enhancements/issues/789 and https://github.com/kubernetes/kubernetes/pull/73807
* documentation review feedback
* CSI raw block to beta (#12931)
* Change incorrect string raw to block (#12926)
Fixes #12925
* Update documentation on node OS/arch labels (#12976)
These labels have been promoted to GA:
https://github.com/kubernetes/enhancements/issues/793
* local pv GA doc updates (#12915)
* Publish CRD OpenAPI Documentation (#12910)
* add documentation for CustomResourcePublishOpenAPI
* address comments
fix links, ordered lists, style and typo
* kubeadm: add document for upgrading from 1.13 to 1.14 (single CP and HA) (#13189)
* kubeadm: add document for upgrading from 1.13 to 1.14
- remove doc for upgrading 1.10 -> 1.11
* kubeadm: apply amends to upgrade-1.14 doc
* kubeadm: apply amends to upgrade-1.14 doc (part2)
* kubeadm: apply amends to upgrade-1.14 doc (part3)
* kubeadm: add note about "upgrade node experimental-control-plane"
+ add comment about `upgrade plan`
* kubeadm: add missing "You should see output similar to this"
* fix bullet indentation (#13214)
* mark PodReadinessGate GA (#12800)
* Update RuntimeClass documentation for beta (#13043)
* Update RuntimeClass documentation for beta
* Update feature gate & add upgrade section
* formatting fixes
* Highlight upgrade action required
* Address feedback
* CSI ephemeral volume alpha documentation (#10934)
* update kubectl documentation (#12867)
* update kubectl documentation
* add document for Secret/ConfigMap generators
* replace `kubectl create -f` by `kubectl apply -f`
* Add page for kustomization support in kubectl
* fix spelling errors and address comments
* Documentation for Windows GMSA feature (#12936)
* Documentation for Windows GMSA feature
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Enhancements to GMSA docs
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix links
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix GMSA link
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add GMSA feature flag in feature flag list
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Relocate GMSA to container configuration
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add example for container spec
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Remove changes in Windows index
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Update configure-gmsa.md
* Update configure-gmsa.md
* Update configure-gmsa.md
* Rearrange the steps into two sections and other edits
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix links
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add reference to script to generate GMSA YAMLs
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Some more clarifications for GMSA
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* HugePages graduated to GA (#13004)
* HugePages graduated to GA
* fixing nit for build
* Docs for node PID limiting (https://github.com/kubernetes/kubernetes/pull/73651) (#12932)
* kubeadm: update the reference documentation for 1.14 (#12911)
* kubeadm: update list of generated files for 1.14
NOTE: PLACEHOLDERS! these files are generated by SIG Docs each
release, but we need them to pass the k/website PR CI.
- add join_phase* (new sub phases of join)
- add init_phase_upload-certs.md (new upload certs phase for init)
- remove alpha-preflight (now both init and join have this)
* kubeadm: update reference docs includes for 1.14
- remove includes from alpha.md
- add upload-certs to init-phase.md
- add join-phase.md and it's phases
* kubeadm: update the editorial content of join and init
- cleanup master->control-plane node
- add some notes about phases and join
- remove table about pre-pulling images
- remove outdated info about self-hosting
* kubeadm: update target release for v1alpha3 removal
1.14 -> 1.15
* kubeadm: copy edits for 1.14 reference docs (part1)
* kubeadm: use "shell" for code blocks
* kubeadm: update the 1.14 HA guide (#13191)
* kubeadm: update the 1.14 HA guide
* kubeadm: try to fix note/caution indent in HA page
* kubeadm: fix missing sudo and minor amends in HA doc
* kubeadm: apply latest amends to the HA doc for 1.14
* fixed a few missed merge conflicts
* Admission Webhook new features doc (#12938)
- kubernetes/kubernetes#74998
- kubernetes/kubernetes#74477
- kubernetes/kubernetes#74562
* Clarifications and fixes in GMSA doc (#13226)
* Clarifications and fixes in GMSA doc
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Reformat to align headings and pre-reqs better
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reformat to align headings and pre-reqs better
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reformat to fix bullets
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reword application of sample gmsa
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Address feedback to use active voice
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Address feedback to use active voice
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* RunAsGroup documentation for Progressing this to Beta (#12297)
* start serverside-apply documentation (#13077)
* start serverside-apply documentation
* add more concept info on server side apply
* Update api concepts
* Update api-concepts.md
* fix style issues
* Document CSI update (#12928)
* Document CSI update
* Finish CSI documentation
Also fix mistake with ExpandInUsePersistentVolumes documented as beta
* Overall docs for CSI Migration feature (#12935)
* Placeholder docs for CSI Migration feature
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Address CR comments and update feature gates
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add mappings for CSI plugins
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add sections for AWS and GCE PD migration
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add docs for Cinder and CSI Migration info
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Clarify scope to volumes with file system
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Change the format of EBS and Cinder CSI Migration sections to follow the GCE template
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Windows documentation updates for 1.14 (#12929)
* Updated the note to indicate doc work for 1.14
* first attempt at md export from gdoc
* simplifyig
* big attempt
* moving DRAFT windows content to PR for review
* moving content to PR in markdown for review
* updated note tags
* Delete windows-contributing.md
deleting this file as it is already ported to the github contributor guide
* fixed formatting in intro and cluster setup guide
* updating formatting for running containers guide
* rejiggered end of troubleshooting
* fixed minor typos
* Clarified the windows binary download step
* Update _index.md
making updates based on feedback
* Update _index.md
updating ovn-kubernetes docs
* Update _index.md
* Update _index.md
* updating relative docs links
updating all the links to be relative links to /docs
* Update _index.md
* Update _index.md
updates for windows services and ovn-kubernetes
* formatted for correct step numbering
* fix typos
* Update _index.md
updates for flannel PR in troubleshooting
* Update _index.md
* Update _index.md
updating a few sections like roadmap, services, troubleshooting/filing tickets
* Update _index.md
* Update _index.md
* Update _index.md
* Fixed a few whitespace issues
* Update _index.md
* Update _index.md
* Update _index.md
* add section on upgrading CoreDNS (#12909)
* documentation for kubelet resource metrics endpoint (#12934)
* windows docs updates for 1.14 (#13279)
* Delete sample-l2bridge-wincni-config.json
this file is not used anywhere
* Update _index.md
* Update _index.md
* Update _index.md
* Update _index.md
* Update _index.md
* Rename content/en/docs/getting-started-guides/windows/_index.md to content/en/docs/setup/windows/_index.md
moving to new location
* Delete flannel-master-kubectl-get-ds.png
* Delete flannel-master-kubeclt-get-pods.png
* Delete windows-docker-error.png
* Add files via upload
* Rename _index.md to add-windows-nodes.md
* Create _index.md
* Update _index.md
* Update add-windows-nodes.md
* Update add-windows-nodes.md
* Create user-guide-windows-nodes.md
* Create user-guide-windows-containers.md
* Update and rename add-windows-nodes.md to intro-windows-nodes.md
* Update user-guide-windows-containers.md
* Rename intro-windows-nodes.md to intro-windows-in-kubernetes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-containers.md
* Update _index.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
fixing the pause image
* Update intro-windows-in-kubernetes.md
changing tables from html to MD
* Update user-guide-windows-nodes.md
converting tables from HTML to MD
* Update intro-windows-in-kubernetes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-nodes.md
updating the numbering , even though it messes up the notes a little bit. Jim will file a ticket to follow up
* Update user-guide-windows-nodes.md
* update to windows docs for 1.14 (#13322)
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-nodes.md
* Update intro-windows-in-kubernetes.md (#13344)
* server side apply followup (#13321)
* change some parts of serverside apply docs in response to comments
* fix typos and wording
* Update config.toml (#13365)
2019-03-25 22:06:16 +00:00
|
|
|
kubectl apply -f ./run-my-nginx.yaml
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl get pods -l run=my-nginx -o wide
|
|
|
|
```
|
|
|
|
```
|
2017-03-28 06:39:30 +00:00
|
|
|
NAME READY STATUS RESTARTS AGE IP NODE
|
|
|
|
my-nginx-3800858182-jr4a2 1/1 Running 0 13s 10.244.3.4 kubernetes-minion-905m
|
|
|
|
my-nginx-3800858182-kna2y 1/1 Running 0 13s 10.244.2.5 kubernetes-minion-ljyd
|
2017-03-16 23:50:19 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Check your pods' IPs:
|
|
|
|
|
|
|
|
```shell
|
2022-06-22 01:36:47 +00:00
|
|
|
kubectl get pods -l run=my-nginx -o custom-columns=POD_IP:.status.podIPs
|
2022-06-27 06:26:01 +00:00
|
|
|
POD_IP
|
|
|
|
[map[ip:10.244.3.4]]
|
|
|
|
[map[ip:10.244.2.5]]
|
2017-03-16 23:50:19 +00:00
|
|
|
```
|
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
You should be able to ssh into any node in your cluster and use a tool such as `curl`
|
|
|
|
to make queries against both IPs. Note that the containers are *not* using port 80 on
|
|
|
|
the node, nor are there any special NAT rules to route traffic to the pod. This means
|
|
|
|
you can run multiple nginx pods on the same node all using the same `containerPort`,
|
|
|
|
and access them from any other pod or node in your cluster using the assigned IP
|
|
|
|
address for the Service. If you want to arrange for a specific port on the host
|
|
|
|
Node to be forwarded to backing Pods, you can - but the networking model should
|
|
|
|
mean that you do not need to do so.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
You can read more about the
|
|
|
|
[Kubernetes Networking Model](/docs/concepts/cluster-administration/networking/#the-kubernetes-network-model)
|
|
|
|
if you're curious.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
## Creating a Service
|
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
So we have pods running nginx in a flat, cluster wide, address space. In theory,
|
|
|
|
you could talk to these pods directly, but what happens when a node dies? The pods
|
|
|
|
die with it, and the Deployment will create new ones, with different IPs. This is
|
|
|
|
the problem a Service solves.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
A Kubernetes Service is an abstraction which defines a logical set of Pods running
|
|
|
|
somewhere in your cluster, that all provide the same functionality. When created,
|
|
|
|
each Service is assigned a unique IP address (also called clusterIP). This address
|
|
|
|
is tied to the lifespan of the Service, and will not change while the Service is alive.
|
|
|
|
Pods can be configured to talk to the Service, and know that communication to the
|
|
|
|
Service will be automatically load-balanced out to some pod that is a member of the Service.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
You can create a Service for your 2 nginx replicas with `kubectl expose`:
|
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl expose deployment/my-nginx
|
|
|
|
```
|
|
|
|
```
|
2018-10-04 02:50:10 +00:00
|
|
|
service/my-nginx exposed
|
2017-03-16 23:50:19 +00:00
|
|
|
```
|
|
|
|
|
Official 1.14 Release Docs (#13174)
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S. (#11752)
* Added documentation about Poseidon-Firmament scheduler
* Fixed some style issues.
* Udpated the document as per the review comments.
* Fixed some typos and updated the document
* Updated the document as per the review comments.
* Document timeout attribute for kms-plugin. (#12158)
See 72540.
* Official documentation on Poseidon/Firmament, a new multi-scheduler (#12343)
* Removed the old version of the Poseidon documentation. Incorrect location.
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S (#12069)
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S. (#11752)
* Added documentation about Poseidon-Firmament scheduler
* Fixed some style issues.
* Udpated the document as per the review comments.
* Fixed some typos and updated the document
* Updated the document as per the review comments.
* Updated the document as per review comments. Added config details.
* Updated the document as per the latest review comments. Fixed nits
* Made changes as per latest suggestions.
* Some more changes added.
* Updated as per suggestions.
* Changed the release process section.
* SIG Docs edits
Small edits to match style guidelines.
* add plus to feature state
* capitalization
* revert feature state shortcode
since this is a Kubernetes extension, not a direct feature, it shouldn't use the regular feature state tagging.
(cherry picked from commit 7730c1540b637be74b9b21d4128a145994eb19cc)
* Remove initializers from doc. It will be removed in 1.14 (#12331)
* kubeadm: Document CRI auto detection functionality (#12462)
Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
* Minor doc change for GAing Pod DNS Config (#12514)
* Graduate ExpandInUsePersistentVolumes feature to beta (#10574)
* Rename 2018-11-07-grpc-load-balancing-with-linkerd.md.md file (#12594)
* Add dynamic percentage of node scoring to user docs (#12235)
* Add dynamic percentage of node scoring to user docs
* addressed review comments
* delete special symbol (#12445)
* Update documentation for VolumeSubpathEnvExpansion (#11843)
* Update documentation for VolumeSubpathEnvExpansion
* Address comments - improve descriptions
* Graduate Pod Priority and Preemption to GA (#12428)
* Added Instana links to the documentation (#12977)
* Added link to the Instana Kubernetes integration
* Added Instana link for services section
Added Instana and a link to the Kubernetes integration to the analytics services section and broadened the scope to APM, monitoring and analytics.
* Oxford comma /flex
* More Oxford commas, because they matter
* Update kubectl plugins to stable (#12847)
* documentation for CSI topology beta (#12889)
* Document changes to default RBAC discovery ClusterRole(Binding)s (#12888)
* Document changes to default RBAC discovery ClusterRole(Binding)s
Documentation for https://github.com/kubernetes/enhancements/issues/789 and https://github.com/kubernetes/kubernetes/pull/73807
* documentation review feedback
* CSI raw block to beta (#12931)
* Change incorrect string raw to block (#12926)
Fixes #12925
* Update documentation on node OS/arch labels (#12976)
These labels have been promoted to GA:
https://github.com/kubernetes/enhancements/issues/793
* local pv GA doc updates (#12915)
* Publish CRD OpenAPI Documentation (#12910)
* add documentation for CustomResourcePublishOpenAPI
* address comments
fix links, ordered lists, style and typo
* kubeadm: add document for upgrading from 1.13 to 1.14 (single CP and HA) (#13189)
* kubeadm: add document for upgrading from 1.13 to 1.14
- remove doc for upgrading 1.10 -> 1.11
* kubeadm: apply amends to upgrade-1.14 doc
* kubeadm: apply amends to upgrade-1.14 doc (part2)
* kubeadm: apply amends to upgrade-1.14 doc (part3)
* kubeadm: add note about "upgrade node experimental-control-plane"
+ add comment about `upgrade plan`
* kubeadm: add missing "You should see output similar to this"
* fix bullet indentation (#13214)
* mark PodReadinessGate GA (#12800)
* Update RuntimeClass documentation for beta (#13043)
* Update RuntimeClass documentation for beta
* Update feature gate & add upgrade section
* formatting fixes
* Highlight upgrade action required
* Address feedback
* CSI ephemeral volume alpha documentation (#10934)
* update kubectl documentation (#12867)
* update kubectl documentation
* add document for Secret/ConfigMap generators
* replace `kubectl create -f` by `kubectl apply -f`
* Add page for kustomization support in kubectl
* fix spelling errors and address comments
* Documentation for Windows GMSA feature (#12936)
* Documentation for Windows GMSA feature
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Enhancements to GMSA docs
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix links
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix GMSA link
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add GMSA feature flag in feature flag list
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Relocate GMSA to container configuration
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add example for container spec
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Remove changes in Windows index
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Update configure-gmsa.md
* Update configure-gmsa.md
* Update configure-gmsa.md
* Rearrange the steps into two sections and other edits
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix links
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add reference to script to generate GMSA YAMLs
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Some more clarifications for GMSA
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* HugePages graduated to GA (#13004)
* HugePages graduated to GA
* fixing nit for build
* Docs for node PID limiting (https://github.com/kubernetes/kubernetes/pull/73651) (#12932)
* kubeadm: update the reference documentation for 1.14 (#12911)
* kubeadm: update list of generated files for 1.14
NOTE: PLACEHOLDERS! these files are generated by SIG Docs each
release, but we need them to pass the k/website PR CI.
- add join_phase* (new sub phases of join)
- add init_phase_upload-certs.md (new upload certs phase for init)
- remove alpha-preflight (now both init and join have this)
* kubeadm: update reference docs includes for 1.14
- remove includes from alpha.md
- add upload-certs to init-phase.md
- add join-phase.md and it's phases
* kubeadm: update the editorial content of join and init
- cleanup master->control-plane node
- add some notes about phases and join
- remove table about pre-pulling images
- remove outdated info about self-hosting
* kubeadm: update target release for v1alpha3 removal
1.14 -> 1.15
* kubeadm: copy edits for 1.14 reference docs (part1)
* kubeadm: use "shell" for code blocks
* kubeadm: update the 1.14 HA guide (#13191)
* kubeadm: update the 1.14 HA guide
* kubeadm: try to fix note/caution indent in HA page
* kubeadm: fix missing sudo and minor amends in HA doc
* kubeadm: apply latest amends to the HA doc for 1.14
* fixed a few missed merge conflicts
* Admission Webhook new features doc (#12938)
- kubernetes/kubernetes#74998
- kubernetes/kubernetes#74477
- kubernetes/kubernetes#74562
* Clarifications and fixes in GMSA doc (#13226)
* Clarifications and fixes in GMSA doc
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Reformat to align headings and pre-reqs better
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reformat to align headings and pre-reqs better
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reformat to fix bullets
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reword application of sample gmsa
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Address feedback to use active voice
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Address feedback to use active voice
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* RunAsGroup documentation for Progressing this to Beta (#12297)
* start serverside-apply documentation (#13077)
* start serverside-apply documentation
* add more concept info on server side apply
* Update api concepts
* Update api-concepts.md
* fix style issues
* Document CSI update (#12928)
* Document CSI update
* Finish CSI documentation
Also fix mistake with ExpandInUsePersistentVolumes documented as beta
* Overall docs for CSI Migration feature (#12935)
* Placeholder docs for CSI Migration feature
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Address CR comments and update feature gates
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add mappings for CSI plugins
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add sections for AWS and GCE PD migration
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add docs for Cinder and CSI Migration info
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Clarify scope to volumes with file system
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Change the format of EBS and Cinder CSI Migration sections to follow the GCE template
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Windows documentation updates for 1.14 (#12929)
* Updated the note to indicate doc work for 1.14
* first attempt at md export from gdoc
* simplifyig
* big attempt
* moving DRAFT windows content to PR for review
* moving content to PR in markdown for review
* updated note tags
* Delete windows-contributing.md
deleting this file as it is already ported to the github contributor guide
* fixed formatting in intro and cluster setup guide
* updating formatting for running containers guide
* rejiggered end of troubleshooting
* fixed minor typos
* Clarified the windows binary download step
* Update _index.md
making updates based on feedback
* Update _index.md
updating ovn-kubernetes docs
* Update _index.md
* Update _index.md
* updating relative docs links
updating all the links to be relative links to /docs
* Update _index.md
* Update _index.md
updates for windows services and ovn-kubernetes
* formatted for correct step numbering
* fix typos
* Update _index.md
updates for flannel PR in troubleshooting
* Update _index.md
* Update _index.md
updating a few sections like roadmap, services, troubleshooting/filing tickets
* Update _index.md
* Update _index.md
* Update _index.md
* Fixed a few whitespace issues
* Update _index.md
* Update _index.md
* Update _index.md
* add section on upgrading CoreDNS (#12909)
* documentation for kubelet resource metrics endpoint (#12934)
* windows docs updates for 1.14 (#13279)
* Delete sample-l2bridge-wincni-config.json
this file is not used anywhere
* Update _index.md
* Update _index.md
* Update _index.md
* Update _index.md
* Update _index.md
* Rename content/en/docs/getting-started-guides/windows/_index.md to content/en/docs/setup/windows/_index.md
moving to new location
* Delete flannel-master-kubectl-get-ds.png
* Delete flannel-master-kubeclt-get-pods.png
* Delete windows-docker-error.png
* Add files via upload
* Rename _index.md to add-windows-nodes.md
* Create _index.md
* Update _index.md
* Update add-windows-nodes.md
* Update add-windows-nodes.md
* Create user-guide-windows-nodes.md
* Create user-guide-windows-containers.md
* Update and rename add-windows-nodes.md to intro-windows-nodes.md
* Update user-guide-windows-containers.md
* Rename intro-windows-nodes.md to intro-windows-in-kubernetes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-containers.md
* Update _index.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
fixing the pause image
* Update intro-windows-in-kubernetes.md
changing tables from html to MD
* Update user-guide-windows-nodes.md
converting tables from HTML to MD
* Update intro-windows-in-kubernetes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-nodes.md
updating the numbering , even though it messes up the notes a little bit. Jim will file a ticket to follow up
* Update user-guide-windows-nodes.md
* update to windows docs for 1.14 (#13322)
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-nodes.md
* Update intro-windows-in-kubernetes.md (#13344)
* server side apply followup (#13321)
* change some parts of serverside apply docs in response to comments
* fix typos and wording
* Update config.toml (#13365)
2019-03-25 22:06:16 +00:00
|
|
|
This is equivalent to `kubectl apply -f` the following yaml:
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
{{< codenew file="service/networking/nginx-svc.yaml" >}}
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
This specification will create a Service which targets TCP port 80 on any Pod
|
|
|
|
with the `run: my-nginx` label, and expose it on an abstracted Service port
|
|
|
|
(`targetPort`: is the port the container accepts traffic on, `port`: is the
|
|
|
|
abstracted Service port, which can be any port other pods use to access the
|
|
|
|
Service).
|
|
|
|
View [Service](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#service-v1-core)
|
|
|
|
API object to see the list of supported fields in service definition.
|
2017-03-16 23:50:19 +00:00
|
|
|
Check your Service:
|
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl get svc my-nginx
|
|
|
|
```
|
|
|
|
```
|
fix the command output (#9695)
I have verified on version v1.11
[root@huan40:~]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-17T18:53:20Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-17T18:43:26Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
2018-08-01 01:48:39 +00:00
|
|
|
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
|
|
|
my-nginx ClusterIP 10.0.162.149 <none> 80/TCP 21s
|
2017-03-16 23:50:19 +00:00
|
|
|
```
|
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
As mentioned previously, a Service is backed by a group of Pods. These Pods are
|
2022-08-25 21:05:09 +00:00
|
|
|
exposed through
|
|
|
|
{{<glossary_tooltip term_id="endpoint-slice" text="EndpointSlices">}}.
|
|
|
|
The Service's selector will be evaluated continuously and the results will be POSTed
|
|
|
|
to an EndpointSlice that is connected to the Service using a
|
|
|
|
{{< glossary_tooltip text="labels" term_id="label" >}}.
|
|
|
|
When a Pod dies, it is automatically removed from the EndpointSlices that contain it
|
|
|
|
as an endpoint. New Pods that match the Service's selector will automatically get added
|
|
|
|
to an EndpointSlice for that Service.
|
2018-07-10 15:56:25 +00:00
|
|
|
Check the endpoints, and note that the IPs are the same as the Pods created in
|
|
|
|
the first step:
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl describe svc my-nginx
|
|
|
|
```
|
|
|
|
```
|
2017-03-23 07:10:00 +00:00
|
|
|
Name: my-nginx
|
|
|
|
Namespace: default
|
|
|
|
Labels: run=my-nginx
|
2017-09-05 02:13:21 +00:00
|
|
|
Annotations: <none>
|
2017-03-23 07:10:00 +00:00
|
|
|
Selector: run=my-nginx
|
|
|
|
Type: ClusterIP
|
2023-01-18 17:52:27 +00:00
|
|
|
IP Family Policy: SingleStack
|
|
|
|
IP Families: IPv4
|
2017-03-23 07:10:00 +00:00
|
|
|
IP: 10.0.162.149
|
2023-01-18 17:52:27 +00:00
|
|
|
IPs: 10.0.162.149
|
2017-03-23 07:10:00 +00:00
|
|
|
Port: <unset> 80/TCP
|
2023-01-18 17:52:27 +00:00
|
|
|
TargetPort: 80/TCP
|
2017-03-23 07:10:00 +00:00
|
|
|
Endpoints: 10.244.2.5:80,10.244.3.4:80
|
|
|
|
Session Affinity: None
|
2017-09-05 02:13:21 +00:00
|
|
|
Events: <none>
|
2019-03-07 09:31:05 +00:00
|
|
|
```
|
|
|
|
```shell
|
2022-08-25 21:05:09 +00:00
|
|
|
kubectl get endpointslices -l kubernetes.io/service-name=my-nginx
|
2019-03-07 09:31:05 +00:00
|
|
|
```
|
|
|
|
```
|
2022-08-25 21:05:09 +00:00
|
|
|
NAME ADDRESSTYPE PORTS ENDPOINTS AGE
|
|
|
|
my-nginx-7vzhx IPv4 80 10.244.2.5,10.244.3.4 21s
|
2017-03-16 23:50:19 +00:00
|
|
|
```
|
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
You should now be able to curl the nginx Service on `<CLUSTER-IP>:<PORT>` from
|
|
|
|
any node in your cluster. Note that the Service IP is completely virtual, it
|
|
|
|
never hits the wire. If you're curious about how this works you can read more
|
2023-07-05 13:02:00 +00:00
|
|
|
about the [service proxy](/docs/reference/networking/virtual-ips/).
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
## Accessing the Service
|
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
Kubernetes supports 2 primary modes of finding a Service - environment variables
|
|
|
|
and DNS. The former works out of the box while the latter requires the
|
2023-04-14 18:39:42 +00:00
|
|
|
[CoreDNS cluster addon](https://releases.k8s.io/v{{< skew currentPatchVersion >}}/cluster/addons/dns/coredns).
|
2023-01-25 11:38:30 +00:00
|
|
|
|
2019-08-06 07:49:55 +00:00
|
|
|
{{< note >}}
|
2023-01-25 11:38:30 +00:00
|
|
|
If the service environment variables are not desired (because possible clashing
|
|
|
|
with expected program ones, too many variables to process, only using DNS, etc)
|
|
|
|
you can disable this mode by setting the `enableServiceLinks` flag to `false` on
|
2023-04-14 18:39:42 +00:00
|
|
|
the [pod spec](/docs/reference/generated/kubernetes-api/v{{< skew latestVersion >}}/#pod-v1-core).
|
2019-08-06 07:49:55 +00:00
|
|
|
{{< /note >}}
|
|
|
|
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
### Environment Variables
|
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
When a Pod runs on a Node, the kubelet adds a set of environment variables for
|
|
|
|
each active Service. This introduces an ordering problem. To see why, inspect
|
|
|
|
the environment of your running nginx Pods (your Pod name will be different):
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl exec my-nginx-3800858182-jr4a2 -- printenv | grep SERVICE
|
|
|
|
```
|
|
|
|
```
|
2017-03-16 23:50:19 +00:00
|
|
|
KUBERNETES_SERVICE_HOST=10.0.0.1
|
|
|
|
KUBERNETES_SERVICE_PORT=443
|
|
|
|
KUBERNETES_SERVICE_PORT_HTTPS=443
|
|
|
|
```
|
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
Note there's no mention of your Service. This is because you created the replicas
|
|
|
|
before the Service. Another disadvantage of doing this is that the scheduler might
|
|
|
|
put both Pods on the same machine, which will take your entire Service down if
|
|
|
|
it dies. We can do this the right way by killing the 2 Pods and waiting for the
|
|
|
|
Deployment to recreate them. This time around the Service exists *before* the
|
|
|
|
replicas. This will give you scheduler-level Service spreading of your Pods
|
|
|
|
(provided all your nodes have equal capacity), as well as the right environment
|
|
|
|
variables:
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl scale deployment my-nginx --replicas=0; kubectl scale deployment my-nginx --replicas=2;
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl get pods -l run=my-nginx -o wide
|
|
|
|
```
|
|
|
|
```
|
2017-05-26 03:28:25 +00:00
|
|
|
NAME READY STATUS RESTARTS AGE IP NODE
|
|
|
|
my-nginx-3800858182-e9ihh 1/1 Running 0 5s 10.244.2.7 kubernetes-minion-ljyd
|
|
|
|
my-nginx-3800858182-j4rm4 1/1 Running 0 5s 10.244.3.8 kubernetes-minion-905m
|
2017-03-16 23:50:19 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
You may notice that the pods have different names, since they are killed and recreated.
|
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl exec my-nginx-3800858182-e9ihh -- printenv | grep SERVICE
|
|
|
|
```
|
|
|
|
```
|
2017-03-16 23:50:19 +00:00
|
|
|
KUBERNETES_SERVICE_PORT=443
|
|
|
|
MY_NGINX_SERVICE_HOST=10.0.162.149
|
|
|
|
KUBERNETES_SERVICE_HOST=10.0.0.1
|
|
|
|
MY_NGINX_SERVICE_PORT=80
|
|
|
|
KUBERNETES_SERVICE_PORT_HTTPS=443
|
|
|
|
```
|
|
|
|
|
|
|
|
### DNS
|
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
Kubernetes offers a DNS cluster addon Service that automatically assigns dns names
|
|
|
|
to other Services. You can check if it's running on your cluster:
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl get services kube-dns --namespace=kube-system
|
|
|
|
```
|
|
|
|
```
|
fix the command output (#9695)
I have verified on version v1.11
[root@huan40:~]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-17T18:53:20Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-17T18:43:26Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
2018-08-01 01:48:39 +00:00
|
|
|
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
|
|
|
kube-dns ClusterIP 10.0.0.10 <none> 53/UDP,53/TCP 8m
|
2017-03-16 23:50:19 +00:00
|
|
|
```
|
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
The rest of this section will assume you have a Service with a long lived IP
|
2023-01-25 11:38:30 +00:00
|
|
|
(my-nginx), and a DNS server that has assigned a name to that IP. Here we use
|
|
|
|
the CoreDNS cluster addon (application name `kube-dns`), so you can talk to the
|
|
|
|
Service from any pod in your cluster using standard methods (e.g. `gethostbyname()`).
|
|
|
|
If CoreDNS isn't running, you can enable it referring to the
|
|
|
|
[CoreDNS README](https://github.com/coredns/deployment/tree/master/kubernetes)
|
|
|
|
or [Installing CoreDNS](/docs/tasks/administer-cluster/coredns/#installing-coredns).
|
|
|
|
Let's run another curl application to test this:
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
2023-07-01 03:41:26 +00:00
|
|
|
kubectl run curl --image=radial/busyboxplus:curl -i --tty --rm
|
2019-03-07 09:31:05 +00:00
|
|
|
```
|
|
|
|
```
|
2017-03-16 23:50:19 +00:00
|
|
|
Waiting for pod default/curl-131556218-9fnch to be running, status is Pending, pod ready: false
|
|
|
|
Hit enter for command prompt
|
|
|
|
```
|
|
|
|
|
|
|
|
Then, hit enter and run `nslookup my-nginx`:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
[ root@curl-131556218-9fnch:/ ]$ nslookup my-nginx
|
|
|
|
Server: 10.0.0.10
|
|
|
|
Address 1: 10.0.0.10
|
|
|
|
|
|
|
|
Name: my-nginx
|
|
|
|
Address 1: 10.0.162.149
|
|
|
|
```
|
|
|
|
|
|
|
|
## Securing the Service
|
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
Till now we have only accessed the nginx server from within the cluster. Before
|
|
|
|
exposing the Service to the internet, you want to make sure the communication
|
|
|
|
channel is secure. For this, you will need:
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
* Self signed certificates for https (unless you already have an identity certificate)
|
|
|
|
* An nginx server configured to use the certificates
|
2017-10-05 01:25:57 +00:00
|
|
|
* A [secret](/docs/concepts/configuration/secret/) that makes the certificates accessible to pods
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
You can acquire all these from the
|
|
|
|
[nginx https example](https://github.com/kubernetes/examples/tree/master/staging/https-nginx/).
|
|
|
|
This requires having go and make tools installed. If you don't want to install those,
|
|
|
|
then follow the manual steps later. In short:
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
2019-11-18 01:43:41 +00:00
|
|
|
make keys KEY=/tmp/nginx.key CERT=/tmp/nginx.crt
|
|
|
|
kubectl create secret tls nginxsecret --key /tmp/nginx.key --cert /tmp/nginx.crt
|
2019-03-07 09:31:05 +00:00
|
|
|
```
|
|
|
|
```
|
2018-10-04 02:50:10 +00:00
|
|
|
secret/nginxsecret created
|
2019-03-07 09:31:05 +00:00
|
|
|
```
|
|
|
|
```shell
|
|
|
|
kubectl get secrets
|
|
|
|
```
|
|
|
|
```
|
2017-03-28 06:39:30 +00:00
|
|
|
NAME TYPE DATA AGE
|
2019-11-27 00:45:21 +00:00
|
|
|
nginxsecret kubernetes.io/tls 2 1m
|
|
|
|
```
|
|
|
|
And also the configmap:
|
|
|
|
```shell
|
2019-12-03 09:16:57 +00:00
|
|
|
kubectl create configmap nginxconfigmap --from-file=default.conf
|
2019-11-27 00:45:21 +00:00
|
|
|
```
|
|
|
|
```
|
|
|
|
configmap/nginxconfigmap created
|
|
|
|
```
|
|
|
|
```shell
|
|
|
|
kubectl get configmaps
|
|
|
|
```
|
|
|
|
```
|
|
|
|
NAME DATA AGE
|
|
|
|
nginxconfigmap 1 114s
|
2017-03-16 23:50:19 +00:00
|
|
|
```
|
2017-10-31 19:58:02 +00:00
|
|
|
Following are the manual steps to follow in case you run into problems running make (on windows for example):
|
|
|
|
|
|
|
|
```shell
|
2019-10-28 01:49:25 +00:00
|
|
|
# Create a public private key pair
|
2018-03-15 17:18:23 +00:00
|
|
|
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /d/tmp/nginx.key -out /d/tmp/nginx.crt -subj "/CN=my-nginx/O=my-nginx"
|
2019-10-28 01:49:25 +00:00
|
|
|
# Convert the keys to base64 encoding
|
2018-03-15 17:18:23 +00:00
|
|
|
cat /d/tmp/nginx.crt | base64
|
|
|
|
cat /d/tmp/nginx.key | base64
|
2017-10-31 19:58:02 +00:00
|
|
|
```
|
2023-01-25 11:38:30 +00:00
|
|
|
|
|
|
|
Use the output from the previous commands to create a yaml file as follows.
|
|
|
|
The base64 encoded value should all be on a single line.
|
2017-10-31 19:58:02 +00:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
apiVersion: "v1"
|
|
|
|
kind: "Secret"
|
|
|
|
metadata:
|
|
|
|
name: "nginxsecret"
|
|
|
|
namespace: "default"
|
2019-11-27 00:45:21 +00:00
|
|
|
type: kubernetes.io/tls
|
2017-10-31 19:58:02 +00:00
|
|
|
data:
|
2019-11-27 00:45:21 +00:00
|
|
|
tls.crt: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURIekNDQWdlZ0F3SUJBZ0lKQUp5M3lQK0pzMlpJTUEwR0NTcUdTSWIzRFFFQkJRVUFNQ1l4RVRBUEJnTlYKQkFNVENHNW5hVzU0YzNaak1SRXdEd1lEVlFRS0V3aHVaMmx1ZUhOMll6QWVGdzB4TnpFd01qWXdOekEzTVRKYQpGdzB4T0RFd01qWXdOekEzTVRKYU1DWXhFVEFQQmdOVkJBTVRDRzVuYVc1NGMzWmpNUkV3RHdZRFZRUUtFd2h1CloybHVlSE4yWXpDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBSjFxSU1SOVdWM0IKMlZIQlRMRmtobDRONXljMEJxYUhIQktMSnJMcy8vdzZhU3hRS29GbHlJSU94NGUrMlN5ajBFcndCLzlYTnBwbQppeW1CL3JkRldkOXg5UWhBQUxCZkVaTmNiV3NsTVFVcnhBZW50VWt1dk1vLzgvMHRpbGhjc3paenJEYVJ4NEo5Ci82UVRtVVI3a0ZTWUpOWTVQZkR3cGc3dlVvaDZmZ1Voam92VG42eHNVR0M2QURVODBpNXFlZWhNeVI1N2lmU2YKNHZpaXdIY3hnL3lZR1JBRS9mRTRqakxCdmdONjc2SU90S01rZXV3R0ljNDFhd05tNnNTSzRqYUNGeGpYSnZaZQp2by9kTlEybHhHWCtKT2l3SEhXbXNhdGp4WTRaNVk3R1ZoK0QrWnYvcW1mMFgvbVY0Rmo1NzV3ajFMWVBocWtsCmdhSXZYRyt4U1FVQ0F3RUFBYU5RTUU0d0hRWURWUjBPQkJZRUZPNG9OWkI3YXc1OUlsYkROMzhIYkduYnhFVjcKTUI4R0ExVWRJd1FZTUJhQUZPNG9OWkI3YXc1OUlsYkROMzhIYkduYnhFVjdNQXdHQTFVZEV3UUZNQU1CQWY4dwpEUVlKS29aSWh2Y05BUUVGQlFBRGdnRUJBRVhTMW9FU0lFaXdyMDhWcVA0K2NwTHI3TW5FMTducDBvMm14alFvCjRGb0RvRjdRZnZqeE04Tzd2TjB0clcxb2pGSW0vWDE4ZnZaL3k4ZzVaWG40Vm8zc3hKVmRBcStNZC9jTStzUGEKNmJjTkNUekZqeFpUV0UrKzE5NS9zb2dmOUZ3VDVDK3U2Q3B5N0M3MTZvUXRUakViV05VdEt4cXI0Nk1OZWNCMApwRFhWZmdWQTRadkR4NFo3S2RiZDY5eXM3OVFHYmg5ZW1PZ05NZFlsSUswSGt0ejF5WU4vbVpmK3FqTkJqbWZjCkNnMnlwbGQ0Wi8rUUNQZjl3SkoybFIrY2FnT0R4elBWcGxNSEcybzgvTHFDdnh6elZPUDUxeXdLZEtxaUMwSVEKQ0I5T2wwWW5scE9UNEh1b2hSUzBPOStlMm9KdFZsNUIyczRpbDlhZ3RTVXFxUlU9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"
|
|
|
|
tls.key: "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2RhaURFZlZsZHdkbFIKd1V5eFpJWmVEZWNuTkFhbWh4d1NpeWF5N1AvOE9ta3NVQ3FCWmNpQ0RzZUh2dGtzbzlCSzhBZi9WemFhWm9zcApnZjYzUlZuZmNmVUlRQUN3WHhHVFhHMXJKVEVGSzhRSHA3VkpMcnpLUC9QOUxZcFlYTE0yYzZ3MmtjZUNmZitrCkU1bEVlNUJVbUNUV09UM3c4S1lPNzFLSWVuNEZJWTZMMDUrc2JGQmd1Z0ExUE5JdWFubm9UTWtlZTRuMG4rTDQKb3NCM01ZUDhtQmtRQlAzeE9JNHl3YjREZXUraURyU2pKSHJzQmlIT05Xc0RadXJFaXVJMmdoY1kxeWIyWHI2UAozVFVOcGNSbC9pVG9zQngxcHJHclk4V09HZVdPeGxZZmcvbWIvNnBuOUYvNWxlQlkrZStjSTlTMkQ0YXBKWUdpCkwxeHZzVWtGQWdNQkFBRUNnZ0VBZFhCK0xkbk8ySElOTGo5bWRsb25IUGlHWWVzZ294RGQwci9hQ1Zkank4dlEKTjIwL3FQWkUxek1yall6Ry9kVGhTMmMwc0QxaTBXSjdwR1lGb0xtdXlWTjltY0FXUTM5SjM0VHZaU2FFSWZWNgo5TE1jUHhNTmFsNjRLMFRVbUFQZytGam9QSFlhUUxLOERLOUtnNXNrSE5pOWNzMlY5ckd6VWlVZWtBL0RBUlBTClI3L2ZjUFBacDRuRWVBZmI3WTk1R1llb1p5V21SU3VKdlNyblBESGtUdW1vVlVWdkxMRHRzaG9reUxiTWVtN3oKMmJzVmpwSW1GTHJqbGtmQXlpNHg0WjJrV3YyMFRrdWtsZU1jaVlMbjk4QWxiRi9DSmRLM3QraTRoMTVlR2ZQegpoTnh3bk9QdlVTaDR2Q0o3c2Q5TmtEUGJvS2JneVVHOXBYamZhRGR2UVFLQmdRRFFLM01nUkhkQ1pKNVFqZWFKClFGdXF4cHdnNzhZTjQyL1NwenlUYmtGcVFoQWtyczJxWGx1MDZBRzhrZzIzQkswaHkzaE9zSGgxcXRVK3NHZVAKOWRERHBsUWV0ODZsY2FlR3hoc0V0L1R6cEdtNGFKSm5oNzVVaTVGZk9QTDhPTm1FZ3MxMVRhUldhNzZxelRyMgphRlpjQ2pWV1g0YnRSTHVwSkgrMjZnY0FhUUtCZ1FEQmxVSUUzTnNVOFBBZEYvL25sQVB5VWs1T3lDdWc3dmVyClUycXlrdXFzYnBkSi9hODViT1JhM05IVmpVM25uRGpHVHBWaE9JeXg5TEFrc2RwZEFjVmxvcG9HODhXYk9lMTAKMUdqbnkySmdDK3JVWUZiRGtpUGx1K09IYnRnOXFYcGJMSHBzUVpsMGhucDBYSFNYVm9CMUliQndnMGEyOFVadApCbFBtWmc2d1BRS0JnRHVIUVV2SDZHYTNDVUsxNFdmOFhIcFFnMU16M2VvWTBPQm5iSDRvZUZKZmcraEppSXlnCm9RN3hqWldVR3BIc3AyblRtcHErQWlSNzdyRVhsdlhtOElVU2FsbkNiRGlKY01Pc29RdFBZNS9NczJMRm5LQTQKaENmL0pWb2FtZm1nZEN0ZGtFMXNINE9MR2lJVHdEbTRpb0dWZGIwMllnbzFyb2htNUpLMUI3MkpBb0dBUW01UQpHNDhXOTVhL0w1eSt5dCsyZ3YvUHM2VnBvMjZlTzRNQ3lJazJVem9ZWE9IYnNkODJkaC8xT2sybGdHZlI2K3VuCnc1YytZUXRSTHlhQmd3MUtpbGhFZDBKTWU3cGpUSVpnQWJ0LzVPbnlDak9OVXN2aDJjS2lrQ1Z2dTZsZlBjNkQKckliT2ZIaHhxV0RZK2Q1TGN1YSt2NzJ0RkxhenJsSlBsRzlOZHhrQ2dZRUF5elIzT3UyMDNRVVV6bUlCRkwzZAp4Wm5XZ0JLSEo3TnNxcGFWb2RjL0d5aGVycjFDZzE2MmJaSjJDV2RsZkI0VEdtUjZZdmxTZEFOOFRwUWhFbUtKCnFBLzVzdHdxNWd0WGVLOVJmMWxXK29xNThRNTBxMmk1NVdUTThoSDZhTjlaMTltZ0FGdE5VdGNqQUx2dFYxdEYKWSs4WFJkSHJaRnBIWll2NWkwVW1VbGc9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K"
|
2017-10-31 19:58:02 +00:00
|
|
|
```
|
|
|
|
Now create the secrets using the file:
|
|
|
|
|
|
|
|
```shell
|
Official 1.14 Release Docs (#13174)
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S. (#11752)
* Added documentation about Poseidon-Firmament scheduler
* Fixed some style issues.
* Udpated the document as per the review comments.
* Fixed some typos and updated the document
* Updated the document as per the review comments.
* Document timeout attribute for kms-plugin. (#12158)
See 72540.
* Official documentation on Poseidon/Firmament, a new multi-scheduler (#12343)
* Removed the old version of the Poseidon documentation. Incorrect location.
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S (#12069)
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S. (#11752)
* Added documentation about Poseidon-Firmament scheduler
* Fixed some style issues.
* Udpated the document as per the review comments.
* Fixed some typos and updated the document
* Updated the document as per the review comments.
* Updated the document as per review comments. Added config details.
* Updated the document as per the latest review comments. Fixed nits
* Made changes as per latest suggestions.
* Some more changes added.
* Updated as per suggestions.
* Changed the release process section.
* SIG Docs edits
Small edits to match style guidelines.
* add plus to feature state
* capitalization
* revert feature state shortcode
since this is a Kubernetes extension, not a direct feature, it shouldn't use the regular feature state tagging.
(cherry picked from commit 7730c1540b637be74b9b21d4128a145994eb19cc)
* Remove initializers from doc. It will be removed in 1.14 (#12331)
* kubeadm: Document CRI auto detection functionality (#12462)
Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
* Minor doc change for GAing Pod DNS Config (#12514)
* Graduate ExpandInUsePersistentVolumes feature to beta (#10574)
* Rename 2018-11-07-grpc-load-balancing-with-linkerd.md.md file (#12594)
* Add dynamic percentage of node scoring to user docs (#12235)
* Add dynamic percentage of node scoring to user docs
* addressed review comments
* delete special symbol (#12445)
* Update documentation for VolumeSubpathEnvExpansion (#11843)
* Update documentation for VolumeSubpathEnvExpansion
* Address comments - improve descriptions
* Graduate Pod Priority and Preemption to GA (#12428)
* Added Instana links to the documentation (#12977)
* Added link to the Instana Kubernetes integration
* Added Instana link for services section
Added Instana and a link to the Kubernetes integration to the analytics services section and broadened the scope to APM, monitoring and analytics.
* Oxford comma /flex
* More Oxford commas, because they matter
* Update kubectl plugins to stable (#12847)
* documentation for CSI topology beta (#12889)
* Document changes to default RBAC discovery ClusterRole(Binding)s (#12888)
* Document changes to default RBAC discovery ClusterRole(Binding)s
Documentation for https://github.com/kubernetes/enhancements/issues/789 and https://github.com/kubernetes/kubernetes/pull/73807
* documentation review feedback
* CSI raw block to beta (#12931)
* Change incorrect string raw to block (#12926)
Fixes #12925
* Update documentation on node OS/arch labels (#12976)
These labels have been promoted to GA:
https://github.com/kubernetes/enhancements/issues/793
* local pv GA doc updates (#12915)
* Publish CRD OpenAPI Documentation (#12910)
* add documentation for CustomResourcePublishOpenAPI
* address comments
fix links, ordered lists, style and typo
* kubeadm: add document for upgrading from 1.13 to 1.14 (single CP and HA) (#13189)
* kubeadm: add document for upgrading from 1.13 to 1.14
- remove doc for upgrading 1.10 -> 1.11
* kubeadm: apply amends to upgrade-1.14 doc
* kubeadm: apply amends to upgrade-1.14 doc (part2)
* kubeadm: apply amends to upgrade-1.14 doc (part3)
* kubeadm: add note about "upgrade node experimental-control-plane"
+ add comment about `upgrade plan`
* kubeadm: add missing "You should see output similar to this"
* fix bullet indentation (#13214)
* mark PodReadinessGate GA (#12800)
* Update RuntimeClass documentation for beta (#13043)
* Update RuntimeClass documentation for beta
* Update feature gate & add upgrade section
* formatting fixes
* Highlight upgrade action required
* Address feedback
* CSI ephemeral volume alpha documentation (#10934)
* update kubectl documentation (#12867)
* update kubectl documentation
* add document for Secret/ConfigMap generators
* replace `kubectl create -f` by `kubectl apply -f`
* Add page for kustomization support in kubectl
* fix spelling errors and address comments
* Documentation for Windows GMSA feature (#12936)
* Documentation for Windows GMSA feature
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Enhancements to GMSA docs
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix links
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix GMSA link
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add GMSA feature flag in feature flag list
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Relocate GMSA to container configuration
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add example for container spec
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Remove changes in Windows index
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Update configure-gmsa.md
* Update configure-gmsa.md
* Update configure-gmsa.md
* Rearrange the steps into two sections and other edits
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix links
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add reference to script to generate GMSA YAMLs
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Some more clarifications for GMSA
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* HugePages graduated to GA (#13004)
* HugePages graduated to GA
* fixing nit for build
* Docs for node PID limiting (https://github.com/kubernetes/kubernetes/pull/73651) (#12932)
* kubeadm: update the reference documentation for 1.14 (#12911)
* kubeadm: update list of generated files for 1.14
NOTE: PLACEHOLDERS! these files are generated by SIG Docs each
release, but we need them to pass the k/website PR CI.
- add join_phase* (new sub phases of join)
- add init_phase_upload-certs.md (new upload certs phase for init)
- remove alpha-preflight (now both init and join have this)
* kubeadm: update reference docs includes for 1.14
- remove includes from alpha.md
- add upload-certs to init-phase.md
- add join-phase.md and it's phases
* kubeadm: update the editorial content of join and init
- cleanup master->control-plane node
- add some notes about phases and join
- remove table about pre-pulling images
- remove outdated info about self-hosting
* kubeadm: update target release for v1alpha3 removal
1.14 -> 1.15
* kubeadm: copy edits for 1.14 reference docs (part1)
* kubeadm: use "shell" for code blocks
* kubeadm: update the 1.14 HA guide (#13191)
* kubeadm: update the 1.14 HA guide
* kubeadm: try to fix note/caution indent in HA page
* kubeadm: fix missing sudo and minor amends in HA doc
* kubeadm: apply latest amends to the HA doc for 1.14
* fixed a few missed merge conflicts
* Admission Webhook new features doc (#12938)
- kubernetes/kubernetes#74998
- kubernetes/kubernetes#74477
- kubernetes/kubernetes#74562
* Clarifications and fixes in GMSA doc (#13226)
* Clarifications and fixes in GMSA doc
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Reformat to align headings and pre-reqs better
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reformat to align headings and pre-reqs better
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reformat to fix bullets
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reword application of sample gmsa
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Address feedback to use active voice
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Address feedback to use active voice
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* RunAsGroup documentation for Progressing this to Beta (#12297)
* start serverside-apply documentation (#13077)
* start serverside-apply documentation
* add more concept info on server side apply
* Update api concepts
* Update api-concepts.md
* fix style issues
* Document CSI update (#12928)
* Document CSI update
* Finish CSI documentation
Also fix mistake with ExpandInUsePersistentVolumes documented as beta
* Overall docs for CSI Migration feature (#12935)
* Placeholder docs for CSI Migration feature
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Address CR comments and update feature gates
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add mappings for CSI plugins
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add sections for AWS and GCE PD migration
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add docs for Cinder and CSI Migration info
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Clarify scope to volumes with file system
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Change the format of EBS and Cinder CSI Migration sections to follow the GCE template
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Windows documentation updates for 1.14 (#12929)
* Updated the note to indicate doc work for 1.14
* first attempt at md export from gdoc
* simplifyig
* big attempt
* moving DRAFT windows content to PR for review
* moving content to PR in markdown for review
* updated note tags
* Delete windows-contributing.md
deleting this file as it is already ported to the github contributor guide
* fixed formatting in intro and cluster setup guide
* updating formatting for running containers guide
* rejiggered end of troubleshooting
* fixed minor typos
* Clarified the windows binary download step
* Update _index.md
making updates based on feedback
* Update _index.md
updating ovn-kubernetes docs
* Update _index.md
* Update _index.md
* updating relative docs links
updating all the links to be relative links to /docs
* Update _index.md
* Update _index.md
updates for windows services and ovn-kubernetes
* formatted for correct step numbering
* fix typos
* Update _index.md
updates for flannel PR in troubleshooting
* Update _index.md
* Update _index.md
updating a few sections like roadmap, services, troubleshooting/filing tickets
* Update _index.md
* Update _index.md
* Update _index.md
* Fixed a few whitespace issues
* Update _index.md
* Update _index.md
* Update _index.md
* add section on upgrading CoreDNS (#12909)
* documentation for kubelet resource metrics endpoint (#12934)
* windows docs updates for 1.14 (#13279)
* Delete sample-l2bridge-wincni-config.json
this file is not used anywhere
* Update _index.md
* Update _index.md
* Update _index.md
* Update _index.md
* Update _index.md
* Rename content/en/docs/getting-started-guides/windows/_index.md to content/en/docs/setup/windows/_index.md
moving to new location
* Delete flannel-master-kubectl-get-ds.png
* Delete flannel-master-kubeclt-get-pods.png
* Delete windows-docker-error.png
* Add files via upload
* Rename _index.md to add-windows-nodes.md
* Create _index.md
* Update _index.md
* Update add-windows-nodes.md
* Update add-windows-nodes.md
* Create user-guide-windows-nodes.md
* Create user-guide-windows-containers.md
* Update and rename add-windows-nodes.md to intro-windows-nodes.md
* Update user-guide-windows-containers.md
* Rename intro-windows-nodes.md to intro-windows-in-kubernetes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-containers.md
* Update _index.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
fixing the pause image
* Update intro-windows-in-kubernetes.md
changing tables from html to MD
* Update user-guide-windows-nodes.md
converting tables from HTML to MD
* Update intro-windows-in-kubernetes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-nodes.md
updating the numbering , even though it messes up the notes a little bit. Jim will file a ticket to follow up
* Update user-guide-windows-nodes.md
* update to windows docs for 1.14 (#13322)
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-nodes.md
* Update intro-windows-in-kubernetes.md (#13344)
* server side apply followup (#13321)
* change some parts of serverside apply docs in response to comments
* fix typos and wording
* Update config.toml (#13365)
2019-03-25 22:06:16 +00:00
|
|
|
kubectl apply -f nginxsecrets.yaml
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl get secrets
|
|
|
|
```
|
|
|
|
```
|
2017-10-31 19:58:02 +00:00
|
|
|
NAME TYPE DATA AGE
|
2019-11-27 00:45:21 +00:00
|
|
|
nginxsecret kubernetes.io/tls 2 1m
|
2017-10-31 19:58:02 +00:00
|
|
|
```
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
Now modify your nginx replicas to start an https server using the certificate
|
|
|
|
in the secret, and the Service, to expose both ports (80 and 443):
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
{{< codenew file="service/networking/nginx-secure-app.yaml" >}}
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
Noteworthy points about the nginx-secure-app manifest:
|
|
|
|
|
2017-03-22 01:56:35 +00:00
|
|
|
- It contains both Deployment and Service specification in the same file.
|
2021-08-10 03:15:28 +00:00
|
|
|
- The [nginx server](https://github.com/kubernetes/examples/tree/master/staging/https-nginx/default.conf)
|
2018-07-10 15:56:25 +00:00
|
|
|
serves HTTP traffic on port 80 and HTTPS traffic on 443, and nginx Service
|
|
|
|
exposes both ports.
|
|
|
|
- Each container has access to the keys through a volume mounted at `/etc/nginx/ssl`.
|
2022-07-21 17:41:01 +00:00
|
|
|
This is set up *before* the nginx server is started.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl delete deployments,svc my-nginx; kubectl create -f ./nginx-secure-app.yaml
|
2017-03-16 23:50:19 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
At this point you can reach the nginx server from any node.
|
|
|
|
|
|
|
|
```shell
|
2022-08-25 03:59:44 +00:00
|
|
|
kubectl get pods -l run=my-nginx -o custom-columns=POD_IP:.status.podIPs
|
|
|
|
POD_IP
|
|
|
|
[map[ip:10.244.3.5]]
|
2022-06-19 09:25:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```shell
|
2017-03-16 23:50:19 +00:00
|
|
|
node $ curl -k https://10.244.3.5
|
|
|
|
...
|
|
|
|
<h1>Welcome to nginx!</h1>
|
|
|
|
```
|
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
Note how we supplied the `-k` parameter to curl in the last step, this is because
|
|
|
|
we don't know anything about the pods running nginx at certificate generation time,
|
|
|
|
so we have to tell curl to ignore the CName mismatch. By creating a Service we
|
|
|
|
linked the CName used in the certificate with the actual DNS name used by pods
|
|
|
|
during Service lookup. Let's test this from a pod (the same secret is being reused
|
|
|
|
for simplicity, the pod only needs nginx.crt to access the Service):
|
2017-03-16 23:50:19 +00:00
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
{{< codenew file="service/networking/curlpod.yaml" >}}
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
Official 1.14 Release Docs (#13174)
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S. (#11752)
* Added documentation about Poseidon-Firmament scheduler
* Fixed some style issues.
* Udpated the document as per the review comments.
* Fixed some typos and updated the document
* Updated the document as per the review comments.
* Document timeout attribute for kms-plugin. (#12158)
See 72540.
* Official documentation on Poseidon/Firmament, a new multi-scheduler (#12343)
* Removed the old version of the Poseidon documentation. Incorrect location.
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S (#12069)
* Official documentation on Poseidon/Firmament, a new multi-scheduler support for K8S. (#11752)
* Added documentation about Poseidon-Firmament scheduler
* Fixed some style issues.
* Udpated the document as per the review comments.
* Fixed some typos and updated the document
* Updated the document as per the review comments.
* Updated the document as per review comments. Added config details.
* Updated the document as per the latest review comments. Fixed nits
* Made changes as per latest suggestions.
* Some more changes added.
* Updated as per suggestions.
* Changed the release process section.
* SIG Docs edits
Small edits to match style guidelines.
* add plus to feature state
* capitalization
* revert feature state shortcode
since this is a Kubernetes extension, not a direct feature, it shouldn't use the regular feature state tagging.
(cherry picked from commit 7730c1540b637be74b9b21d4128a145994eb19cc)
* Remove initializers from doc. It will be removed in 1.14 (#12331)
* kubeadm: Document CRI auto detection functionality (#12462)
Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
* Minor doc change for GAing Pod DNS Config (#12514)
* Graduate ExpandInUsePersistentVolumes feature to beta (#10574)
* Rename 2018-11-07-grpc-load-balancing-with-linkerd.md.md file (#12594)
* Add dynamic percentage of node scoring to user docs (#12235)
* Add dynamic percentage of node scoring to user docs
* addressed review comments
* delete special symbol (#12445)
* Update documentation for VolumeSubpathEnvExpansion (#11843)
* Update documentation for VolumeSubpathEnvExpansion
* Address comments - improve descriptions
* Graduate Pod Priority and Preemption to GA (#12428)
* Added Instana links to the documentation (#12977)
* Added link to the Instana Kubernetes integration
* Added Instana link for services section
Added Instana and a link to the Kubernetes integration to the analytics services section and broadened the scope to APM, monitoring and analytics.
* Oxford comma /flex
* More Oxford commas, because they matter
* Update kubectl plugins to stable (#12847)
* documentation for CSI topology beta (#12889)
* Document changes to default RBAC discovery ClusterRole(Binding)s (#12888)
* Document changes to default RBAC discovery ClusterRole(Binding)s
Documentation for https://github.com/kubernetes/enhancements/issues/789 and https://github.com/kubernetes/kubernetes/pull/73807
* documentation review feedback
* CSI raw block to beta (#12931)
* Change incorrect string raw to block (#12926)
Fixes #12925
* Update documentation on node OS/arch labels (#12976)
These labels have been promoted to GA:
https://github.com/kubernetes/enhancements/issues/793
* local pv GA doc updates (#12915)
* Publish CRD OpenAPI Documentation (#12910)
* add documentation for CustomResourcePublishOpenAPI
* address comments
fix links, ordered lists, style and typo
* kubeadm: add document for upgrading from 1.13 to 1.14 (single CP and HA) (#13189)
* kubeadm: add document for upgrading from 1.13 to 1.14
- remove doc for upgrading 1.10 -> 1.11
* kubeadm: apply amends to upgrade-1.14 doc
* kubeadm: apply amends to upgrade-1.14 doc (part2)
* kubeadm: apply amends to upgrade-1.14 doc (part3)
* kubeadm: add note about "upgrade node experimental-control-plane"
+ add comment about `upgrade plan`
* kubeadm: add missing "You should see output similar to this"
* fix bullet indentation (#13214)
* mark PodReadinessGate GA (#12800)
* Update RuntimeClass documentation for beta (#13043)
* Update RuntimeClass documentation for beta
* Update feature gate & add upgrade section
* formatting fixes
* Highlight upgrade action required
* Address feedback
* CSI ephemeral volume alpha documentation (#10934)
* update kubectl documentation (#12867)
* update kubectl documentation
* add document for Secret/ConfigMap generators
* replace `kubectl create -f` by `kubectl apply -f`
* Add page for kustomization support in kubectl
* fix spelling errors and address comments
* Documentation for Windows GMSA feature (#12936)
* Documentation for Windows GMSA feature
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Enhancements to GMSA docs
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix links
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix GMSA link
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add GMSA feature flag in feature flag list
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Relocate GMSA to container configuration
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add example for container spec
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Remove changes in Windows index
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Update configure-gmsa.md
* Update configure-gmsa.md
* Update configure-gmsa.md
* Rearrange the steps into two sections and other edits
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Fix links
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add reference to script to generate GMSA YAMLs
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Some more clarifications for GMSA
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* HugePages graduated to GA (#13004)
* HugePages graduated to GA
* fixing nit for build
* Docs for node PID limiting (https://github.com/kubernetes/kubernetes/pull/73651) (#12932)
* kubeadm: update the reference documentation for 1.14 (#12911)
* kubeadm: update list of generated files for 1.14
NOTE: PLACEHOLDERS! these files are generated by SIG Docs each
release, but we need them to pass the k/website PR CI.
- add join_phase* (new sub phases of join)
- add init_phase_upload-certs.md (new upload certs phase for init)
- remove alpha-preflight (now both init and join have this)
* kubeadm: update reference docs includes for 1.14
- remove includes from alpha.md
- add upload-certs to init-phase.md
- add join-phase.md and it's phases
* kubeadm: update the editorial content of join and init
- cleanup master->control-plane node
- add some notes about phases and join
- remove table about pre-pulling images
- remove outdated info about self-hosting
* kubeadm: update target release for v1alpha3 removal
1.14 -> 1.15
* kubeadm: copy edits for 1.14 reference docs (part1)
* kubeadm: use "shell" for code blocks
* kubeadm: update the 1.14 HA guide (#13191)
* kubeadm: update the 1.14 HA guide
* kubeadm: try to fix note/caution indent in HA page
* kubeadm: fix missing sudo and minor amends in HA doc
* kubeadm: apply latest amends to the HA doc for 1.14
* fixed a few missed merge conflicts
* Admission Webhook new features doc (#12938)
- kubernetes/kubernetes#74998
- kubernetes/kubernetes#74477
- kubernetes/kubernetes#74562
* Clarifications and fixes in GMSA doc (#13226)
* Clarifications and fixes in GMSA doc
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Reformat to align headings and pre-reqs better
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reformat to align headings and pre-reqs better
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reformat to fix bullets
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Reword application of sample gmsa
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Update configure-gmsa.md
* Address feedback to use active voice
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Address feedback to use active voice
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* RunAsGroup documentation for Progressing this to Beta (#12297)
* start serverside-apply documentation (#13077)
* start serverside-apply documentation
* add more concept info on server side apply
* Update api concepts
* Update api-concepts.md
* fix style issues
* Document CSI update (#12928)
* Document CSI update
* Finish CSI documentation
Also fix mistake with ExpandInUsePersistentVolumes documented as beta
* Overall docs for CSI Migration feature (#12935)
* Placeholder docs for CSI Migration feature
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Address CR comments and update feature gates
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add mappings for CSI plugins
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add sections for AWS and GCE PD migration
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Add docs for Cinder and CSI Migration info
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Clarify scope to volumes with file system
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Change the format of EBS and Cinder CSI Migration sections to follow the GCE template
Signed-off-by: Deep Debroy <ddebroy@docker.com>
* Windows documentation updates for 1.14 (#12929)
* Updated the note to indicate doc work for 1.14
* first attempt at md export from gdoc
* simplifyig
* big attempt
* moving DRAFT windows content to PR for review
* moving content to PR in markdown for review
* updated note tags
* Delete windows-contributing.md
deleting this file as it is already ported to the github contributor guide
* fixed formatting in intro and cluster setup guide
* updating formatting for running containers guide
* rejiggered end of troubleshooting
* fixed minor typos
* Clarified the windows binary download step
* Update _index.md
making updates based on feedback
* Update _index.md
updating ovn-kubernetes docs
* Update _index.md
* Update _index.md
* updating relative docs links
updating all the links to be relative links to /docs
* Update _index.md
* Update _index.md
updates for windows services and ovn-kubernetes
* formatted for correct step numbering
* fix typos
* Update _index.md
updates for flannel PR in troubleshooting
* Update _index.md
* Update _index.md
updating a few sections like roadmap, services, troubleshooting/filing tickets
* Update _index.md
* Update _index.md
* Update _index.md
* Fixed a few whitespace issues
* Update _index.md
* Update _index.md
* Update _index.md
* add section on upgrading CoreDNS (#12909)
* documentation for kubelet resource metrics endpoint (#12934)
* windows docs updates for 1.14 (#13279)
* Delete sample-l2bridge-wincni-config.json
this file is not used anywhere
* Update _index.md
* Update _index.md
* Update _index.md
* Update _index.md
* Update _index.md
* Rename content/en/docs/getting-started-guides/windows/_index.md to content/en/docs/setup/windows/_index.md
moving to new location
* Delete flannel-master-kubectl-get-ds.png
* Delete flannel-master-kubeclt-get-pods.png
* Delete windows-docker-error.png
* Add files via upload
* Rename _index.md to add-windows-nodes.md
* Create _index.md
* Update _index.md
* Update add-windows-nodes.md
* Update add-windows-nodes.md
* Create user-guide-windows-nodes.md
* Create user-guide-windows-containers.md
* Update and rename add-windows-nodes.md to intro-windows-nodes.md
* Update user-guide-windows-containers.md
* Rename intro-windows-nodes.md to intro-windows-in-kubernetes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-containers.md
* Update _index.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
fixing the pause image
* Update intro-windows-in-kubernetes.md
changing tables from html to MD
* Update user-guide-windows-nodes.md
converting tables from HTML to MD
* Update intro-windows-in-kubernetes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-nodes.md
* Update user-guide-windows-nodes.md
updating the numbering , even though it messes up the notes a little bit. Jim will file a ticket to follow up
* Update user-guide-windows-nodes.md
* update to windows docs for 1.14 (#13322)
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update intro-windows-in-kubernetes.md
* Update user-guide-windows-containers.md
* Update user-guide-windows-nodes.md
* Update intro-windows-in-kubernetes.md (#13344)
* server side apply followup (#13321)
* change some parts of serverside apply docs in response to comments
* fix typos and wording
* Update config.toml (#13365)
2019-03-25 22:06:16 +00:00
|
|
|
kubectl apply -f ./curlpod.yaml
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl get pods -l app=curlpod
|
|
|
|
```
|
|
|
|
```
|
2017-03-16 23:50:19 +00:00
|
|
|
NAME READY STATUS RESTARTS AGE
|
|
|
|
curl-deployment-1515033274-1410r 1/1 Running 0 1m
|
2019-03-07 09:31:05 +00:00
|
|
|
```
|
|
|
|
```shell
|
/etc/nginx/ssl/nginx.crt: No such file or directory. Instead use tls.crt (#18324)
Running the example into a katacoda environment I get this error message:
(77) error setting certificate verify locations:
CAfile: /etc/nginx/ssl/nginx.crt
$ kubectl exec curl-deployment-f8c5c685b-9sphf -- ls /etc/nginx/ssl/
tls.crt
tls.key
$ kubectl exec curl-deployment-f8c5c685b-9sphf -- curl https://my-nginx --cacert /etc/nginx/ssl/tls.crt
...
<title>Welcome to nginx!</title>
...
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
$ kubectl describe secret nginxsecret
Name: nginxsecret
Namespace: default
Labels: <none>
Annotations: <none>
Type: kubernetes.io/tls
Data
====
tls.crt: 1164 bytes
tls.key: 1708 bytes
2020-01-06 17:46:16 +00:00
|
|
|
kubectl exec curl-deployment-1515033274-1410r -- curl https://my-nginx --cacert /etc/nginx/ssl/tls.crt
|
2017-03-16 23:50:19 +00:00
|
|
|
...
|
|
|
|
<title>Welcome to nginx!</title>
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
|
|
|
## Exposing the Service
|
|
|
|
|
2018-07-10 15:56:25 +00:00
|
|
|
For some parts of your applications you may want to expose a Service onto an
|
|
|
|
external IP address. Kubernetes supports two ways of doing this: NodePorts and
|
|
|
|
LoadBalancers. The Service created in the last section already used `NodePort`,
|
|
|
|
so your nginx HTTPS replica is ready to serve traffic on the internet if your
|
|
|
|
node has a public IP.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl get svc my-nginx -o yaml | grep nodePort -C 5
|
2017-03-16 23:50:19 +00:00
|
|
|
uid: 07191fb3-f61a-11e5-8ae5-42010af00002
|
|
|
|
spec:
|
|
|
|
clusterIP: 10.0.162.149
|
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
nodePort: 31704
|
|
|
|
port: 8080
|
|
|
|
protocol: TCP
|
|
|
|
targetPort: 80
|
|
|
|
- name: https
|
|
|
|
nodePort: 32453
|
|
|
|
port: 443
|
|
|
|
protocol: TCP
|
|
|
|
targetPort: 443
|
|
|
|
selector:
|
|
|
|
run: my-nginx
|
2019-03-07 09:31:05 +00:00
|
|
|
```
|
|
|
|
```shell
|
|
|
|
kubectl get nodes -o yaml | grep ExternalIP -C 1
|
2017-03-16 23:50:19 +00:00
|
|
|
- address: 104.197.41.11
|
|
|
|
type: ExternalIP
|
|
|
|
allocatable:
|
|
|
|
--
|
|
|
|
- address: 23.251.152.56
|
|
|
|
type: ExternalIP
|
|
|
|
allocatable:
|
|
|
|
...
|
|
|
|
|
|
|
|
$ curl https://<EXTERNAL-IP>:<NODE-PORT> -k
|
|
|
|
...
|
|
|
|
<h1>Welcome to nginx!</h1>
|
|
|
|
```
|
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
Let's now recreate the Service to use a cloud load balancer.
|
|
|
|
Change the `Type` of `my-nginx` Service from `NodePort` to `LoadBalancer`:
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl edit svc my-nginx
|
|
|
|
kubectl get svc my-nginx
|
|
|
|
```
|
|
|
|
```
|
2020-04-10 04:55:14 +00:00
|
|
|
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
2020-05-27 05:15:03 +00:00
|
|
|
my-nginx LoadBalancer 10.0.162.149 xx.xxx.xxx.xxx 8080:30163/TCP 21s
|
2019-03-07 09:31:05 +00:00
|
|
|
```
|
|
|
|
```
|
|
|
|
curl https://<EXTERNAL-IP> -k
|
2017-03-16 23:50:19 +00:00
|
|
|
...
|
|
|
|
<title>Welcome to nginx!</title>
|
|
|
|
```
|
|
|
|
|
2023-01-25 11:38:30 +00:00
|
|
|
The IP address in the `EXTERNAL-IP` column is the one that is available on the public internet.
|
|
|
|
The `CLUSTER-IP` is only available inside your cluster/private cloud network.
|
2017-03-16 23:50:19 +00:00
|
|
|
|
|
|
|
Note that on AWS, type `LoadBalancer` creates an ELB, which uses a (long)
|
|
|
|
hostname, not an IP. It's too long to fit in the standard `kubectl get svc`
|
|
|
|
output, in fact, so you'll need to do `kubectl describe service my-nginx` to
|
|
|
|
see it. You'll see something like this:
|
|
|
|
|
|
|
|
```shell
|
2019-03-07 09:31:05 +00:00
|
|
|
kubectl describe service my-nginx
|
2017-03-16 23:50:19 +00:00
|
|
|
...
|
|
|
|
LoadBalancer Ingress: a320587ffd19711e5a37606cf4a74574-1142138393.us-east-1.elb.amazonaws.com
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
2020-03-16 03:28:35 +00:00
|
|
|
|
2020-05-30 19:10:23 +00:00
|
|
|
|
|
|
|
## {{% heading "whatsnext" %}}
|
|
|
|
|
2020-03-16 03:28:35 +00:00
|
|
|
|
|
|
|
* Learn more about [Using a Service to Access an Application in a Cluster](/docs/tasks/access-application-cluster/service-access-application-cluster/)
|
|
|
|
* Learn more about [Connecting a Front End to a Back End Using a Service](/docs/tasks/access-application-cluster/connecting-frontend-backend/)
|
|
|
|
* Learn more about [Creating an External Load Balancer](/docs/tasks/access-application-cluster/create-external-load-balancer/)
|
|
|
|
|
2020-05-30 19:10:23 +00:00
|
|
|
|