merge conflicts

This commit is contained in:
martyav
2024-09-23 12:12:01 -04:00
812 changed files with 3241 additions and 15622 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ title: Using API Tokens
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/api/api-tokens"/>
</head>
Rancher v2.8.0 introduced the [Rancher Kubernetes API](./api-reference.mdx) which can be used to manage Rancher resources through `kubectl`. This page covers information on API tokens used with the [Rancher CLI](../reference-guides/cli-with-rancher), [kubeconfig files](../how-to-guides/new-user-guides/manage-clusters/access-clusters/authorized-cluster-endpoint.md#about-the-kubeconfig-file), Terraform and the [v3 API browser](./v3-rancher-api-guide.md#enable-view-in-api).
Rancher v2.8.0 introduced the [Rancher Kubernetes API](./api-reference.mdx) which can be used to manage Rancher resources through `kubectl`. This page covers information on API tokens used with the [Rancher CLI](../reference-guides/cli-with-rancher/cli-with-rancher.md), [kubeconfig files](../how-to-guides/new-user-guides/manage-clusters/access-clusters/authorized-cluster-endpoint.md#about-the-kubeconfig-file), Terraform and the [v3 API browser](./v3-rancher-api-guide.md#enable-view-in-api).
By default, some cluster-level API tokens are generated with infinite time-to-live (`ttl=0`). In other words, API tokens with `ttl=0` never expire unless you invalidate them. Tokens are not invalidated by changing a password.
+1 -1
View File
@@ -10,7 +10,7 @@ Rancher v2.8.0 introduced the Rancher Kubernetes API (RK-API). The previous v3 R
## How to Use the API
The previous v3 API has its own user interface accessible from a [web browser](./v3-rancher-api-guide.md#enable-view-in-api). This is an easy way to see resources, perform actions, and see the equivalent `curl` or HTTP request & response. To access it:
The previous v3 API has its own user interface accessible from a [web browser](#enable-view-in-api). This is an easy way to see resources, perform actions, and see the equivalent `curl` or HTTP request & response. To access it:
<Tabs>
<TabItem value="Rancher v2.6.4+">
+4 -3
View File
@@ -6,19 +6,20 @@ title: Deprecated Features in Rancher
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/faq/deprecated-features"/>
</head>
### What is Rancher's deprecation policy?
## What is Rancher's deprecation policy?
We have published our official deprecation policy in the support [terms of service](https://rancher.com/support-maintenance-terms).
### Where can I find out which features have been deprecated in Rancher?
## Where can I find out which features have been deprecated in Rancher?
Rancher will publish deprecated features as part of the [release notes](https://github.com/rancher/rancher/releases) for Rancher found on GitHub. Please consult the following patch releases for deprecated features:
| Patch Version | Release Date |
|---------------|---------------|
| [2.9.2](https://github.com/rancher/rancher/releases/tag/v2.9.2) | Sep 19, 2024 |
| [2.9.1](https://github.com/rancher/rancher/releases/tag/v2.9.1) | Aug 26, 2024 |
| [2.9.0](https://github.com/rancher/rancher/releases/tag/v2.9.0) | Jul 31, 2024 |
### What can I expect when a feature is marked for deprecation?
## What can I expect when a feature is marked for deprecation?
In the release where functionality is marked as "Deprecated", it will still be available and supported allowing upgrades to follow the usual procedure. Once upgraded, users/admins should start planning to move away from the deprecated functionality before upgrading to the release it marked as removed. The recommendation for new deployments is to not use the deprecated feature.
+4 -4
View File
@@ -18,19 +18,19 @@ enable_cri_dockerd: true
For users looking to use another container runtime, Rancher has the edge-focused K3s and datacenter-focused RKE2 Kubernetes distributions that use containerd as the default runtime. Imported RKE2 and K3s Kubernetes clusters can then be upgraded and managed through Rancher even after the removal of in-tree Dockershim in Kubernetes 1.24.
### FAQ
## FAQ
<br/>
Q. Do I have to upgrade Rancher to get Rancher’s support of the upstream Dockershim?
Q: Do I have to upgrade Rancher to get Rancher’s support of the upstream Dockershim?
The upstream support of Dockershim begins for RKE in Kubernetes 1.21. You will need to be on Rancher 2.6 or above to have support for RKE with Kubernetes 1.21. See our [support matrix](https://rancher.com/support-maintenance-terms/all-supported-versions/rancher-v2.6.0/) for details.
<br/>
Q. I am currently on RKE with Kubernetes 1.20. Do I need to upgrade to RKE with Kubernetes 1.21 sooner to avoid being out of support for Dockershim?
Q: I am currently on RKE with Kubernetes 1.20. Do I need to upgrade to RKE with Kubernetes 1.21 sooner to avoid being out of support for Dockershim?
A. The version of Dockershim in RKE with Kubernetes 1.20 will continue to work and is not scheduled for removal upstream until Kubernetes 1.24. It will only emit a warning of its future deprecation, which Rancher has mitigated in RKE with Kubernetes 1.21. You can plan your upgrade to Kubernetes 1.21 as you would normally, but should consider enabling the external Dockershim by Kubernetes 1.22. The external Dockershim will need to be enabled before upgrading to Kubernetes 1.24, at which point the existing implementation will be removed.
A: The version of Dockershim in RKE with Kubernetes 1.20 will continue to work and is not scheduled for removal upstream until Kubernetes 1.24. It will only emit a warning of its future deprecation, which Rancher has mitigated in RKE with Kubernetes 1.21. You can plan your upgrade to Kubernetes 1.21 as you would normally, but should consider enabling the external Dockershim by Kubernetes 1.22. The external Dockershim will need to be enabled before upgrading to Kubernetes 1.24, at which point the existing implementation will be removed.
For more information on the deprecation and its timeline, see the [Kubernetes Dockershim Deprecation FAQ](https://kubernetes.io/blog/2020/12/02/dockershim-faq/#when-will-dockershim-be-removed).
+2 -2
View File
@@ -8,11 +8,11 @@ title: Installing and Configuring kubectl
`kubectl` is a CLI utility for running commands against Kubernetes clusters. It's required for many maintenance and administrative tasks in Rancher 2.x.
### Installation
## Installation
See [kubectl Installation](https://kubernetes.io/docs/tasks/tools/install-kubectl/) for installation on your operating system.
### Configuration
## Configuration
When you create a Kubernetes cluster with RKE, RKE creates a `kube_config_cluster.yml` in the local directory that contains credentials to connect to your new cluster with tools like `kubectl` or `helm`.
+5 -5
View File
@@ -9,11 +9,11 @@ title: Rancher is No Longer Needed
This page is intended to answer questions about what happens if you don't want Rancher anymore, if you don't want a cluster to be managed by Rancher anymore, or if the Rancher server is deleted.
### If the Rancher server is deleted, what happens to the workloads in my downstream clusters?
## If the Rancher server is deleted, what happens to the workloads in my downstream clusters?
If Rancher is ever deleted or unrecoverable, all workloads in the downstream Kubernetes clusters managed by Rancher will continue to function as normal.
### If the Rancher server is deleted, how do I access my downstream clusters?
## If the Rancher server is deleted, how do I access my downstream clusters?
The capability to access a downstream cluster without Rancher depends on the type of cluster and the way that the cluster was created. To summarize:
@@ -21,7 +21,7 @@ The capability to access a downstream cluster without Rancher depends on the typ
- **Hosted Kubernetes clusters:** If you created the cluster in a cloud-hosted Kubernetes provider such as EKS, GKE, or AKS, you can continue to manage the cluster using your provider's cloud credentials.
- **RKE clusters:** To access an [RKE cluster,](../how-to-guides/new-user-guides/launch-kubernetes-with-rancher/launch-kubernetes-with-rancher.md) the cluster must have the [authorized cluster endpoint](../reference-guides/rancher-manager-architecture/communicating-with-downstream-user-clusters.md#4-authorized-cluster-endpoint) enabled, and you must have already downloaded the cluster's kubeconfig file from the Rancher UI. (The authorized cluster endpoint is enabled by default for RKE clusters.) With this endpoint, you can access your cluster with kubectl directly instead of communicating through the Rancher server's [authentication proxy.](../reference-guides/rancher-manager-architecture/communicating-with-downstream-user-clusters.md#1-the-authentication-proxy) For instructions on how to configure kubectl to use the authorized cluster endpoint, refer to the section about directly accessing clusters with [kubectl and the kubeconfig file.](../how-to-guides/new-user-guides/manage-clusters/access-clusters/use-kubectl-and-kubeconfig.md#authenticating-directly-with-a-downstream-cluster) These clusters will use a snapshot of the authentication as it was configured when Rancher was removed.
### What if I don't want Rancher anymore?
## What if I don't want Rancher anymore?
:::note
@@ -44,7 +44,7 @@ If you installed Rancher with Docker, you can uninstall Rancher by removing the
Imported clusters will not be affected by Rancher being removed. For other types of clusters, refer to the section on [accessing downstream clusters when Rancher is removed.](#if-the-rancher-server-is-deleted-how-do-i-access-my-downstream-clusters)
### What if I don't want my registered cluster managed by Rancher?
## What if I don't want my registered cluster managed by Rancher?
If a registered cluster is deleted from the Rancher UI, the cluster is detached from Rancher, leaving it intact and accessible by the same methods that were used to access it before it was registered in Rancher.
@@ -56,7 +56,7 @@ To detach the cluster,
**Result:** The registered cluster is detached from Rancher and functions normally outside of Rancher.
### What if I don't want my RKE cluster or hosted Kubernetes cluster managed by Rancher?
## What if I don't want my RKE cluster or hosted Kubernetes cluster managed by Rancher?
At this time, there is no functionality to detach these clusters from Rancher. In this context, "detach" is defined as the ability to remove Rancher components from the cluster and manage access to the cluster independently of Rancher.
+3 -4
View File
@@ -1,21 +1,20 @@
---
title: Security FAQ
---
<head>
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/faq/security"/>
</head>
### Is there a Hardening Guide?
## Is there a Hardening Guide?
The Hardening Guide is located in the main [Security](../reference-guides/rancher-security/rancher-security.md) section.
### Have hardened Rancher Kubernetes clusters been evaluated by the CIS Kubernetes Benchmark? Where can I find the results?
## Have hardened Rancher Kubernetes clusters been evaluated by the CIS Kubernetes Benchmark? Where can I find the results?
We have run the CIS Kubernetes benchmark against a hardened Rancher Kubernetes cluster. The results of that assessment can be found in the main [Security](../reference-guides/rancher-security/rancher-security.md) section.
### How does Rancher verify communication with downstream clusters, and what are some associated security concerns?
## How does Rancher verify communication with downstream clusters, and what are some associated security concerns?
Communication between the Rancher server and downstream clusters is performed through agents. Rancher uses either a registered certificate authority (CA) bundle or the local trust store to verify communication between Rancher agents and the Rancher server. Using a CA bundle for verification is more strict, as only the certificates based on that bundle are trusted. If TLS verification for a explicit CA bundle fails, Rancher may fall back to using the local trust store for verifying future communication. Any CA within the local trust store can then be used to generate a valid certificate.
+22 -18
View File
@@ -6,9 +6,10 @@ title: Technical FAQ
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/faq/technical-items"/>
</head>
### How can I reset the administrator password?
## How can I reset the administrator password?
Docker install:
Docker Install:
```
$ docker exec -ti <container_id> reset-password
New password for default administrator (user-xxxxx):
@@ -16,6 +17,7 @@ New password for default administrator (user-xxxxx):
```
Kubernetes install (Helm):
```
$ KUBECONFIG=./kube_config_cluster.yml
$ kubectl --kubeconfig $KUBECONFIG -n cattle-system exec $(kubectl --kubeconfig $KUBECONFIG -n cattle-system get pods -l app=rancher --no-headers | head -1 | awk '{ print $1 }') -c rancher -- reset-password
@@ -23,10 +25,10 @@ New password for default administrator (user-xxxxx):
<new_password>
```
## I deleted/deactivated the last admin, how can I fix it?
Docker install:
### I deleted/deactivated the last admin, how can I fix it?
Docker Install:
```
$ docker exec -ti <container_id> ensure-default-admin
New default administrator (user-xxxxx)
@@ -35,38 +37,40 @@ New password for default administrator (user-xxxxx):
```
Kubernetes install (Helm):
```
$ KUBECONFIG=./kube_config_cluster.yml
$ kubectl --kubeconfig $KUBECONFIG -n cattle-system exec $(kubectl --kubeconfig $KUBECONFIG -n cattle-system get pods -l app=rancher | grep '1/1' | head -1 | awk '{ print $1 }') -- ensure-default-admin
New password for default administrator (user-xxxxx):
<new_password>
```
### How can I enable debug logging?
## How can I enable debug logging?
See [Troubleshooting: Logging](../troubleshooting/other-troubleshooting-tips/logging.md)
### My ClusterIP does not respond to ping
## My ClusterIP does not respond to ping
ClusterIP is a virtual IP, which will not respond to ping. Best way to test if the ClusterIP is configured correctly, is by using `curl` to access the IP and port to see if it responds.
### Where can I manage Node Templates?
## Where can I manage Node Templates?
Node Templates can be accessed by opening your account menu (top right) and selecting `Node Templates`.
### Why is my Layer-4 Load Balancer in `Pending` state?
## Why is my Layer-4 Load Balancer in `Pending` state?
The Layer-4 Load Balancer is created as `type: LoadBalancer`. In Kubernetes, this needs a cloud provider or controller that can satisfy these requests, otherwise these will be in `Pending` state forever. More information can be found on [Cloud Providers](../how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/set-up-cloud-providers/set-up-cloud-providers.md) or [Create External Load Balancer](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/)
### Where is the state of Rancher stored?
## Where is the state of Rancher stored?
- Docker Install: in the embedded etcd of the `rancher/rancher` container, located at `/var/lib/rancher`.
- Kubernetes install: in the etcd of the RKE cluster created to run Rancher.
### How are the supported Docker versions determined?
## How are the supported Docker versions determined?
We follow the validated Docker versions for upstream Kubernetes releases. The validated versions can be found under [External Dependencies](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.10.md#external-dependencies) in the Kubernetes release CHANGELOG.md.
### How can I access nodes created by Rancher?
## How can I access nodes created by Rancher?
SSH keys to access the nodes created by Rancher can be downloaded via the **Nodes** view. Choose the node which you want to access and click on the vertical ⋮ button at the end of the row, and choose **Download Keys** as shown in the picture below.
@@ -78,14 +82,14 @@ Unzip the downloaded zip file, and use the file `id_rsa` to connect to you host.
$ ssh -i id_rsa user@ip_of_node
```
### How can I automate task X in Rancher?
## How can I automate task X in Rancher?
The UI consists of static files, and works based on responses of the API. That means every action/task that you can execute in the UI, can be automated via the API. There are 2 ways to do this:
* Visit `https://your_rancher_ip/v3` and browse the API options.
* Capture the API calls when using the UI (Most commonly used for this is [Chrome Developer Tools](https://developers.google.com/web/tools/chrome-devtools/#network) but you can use anything you like)
### The IP address of a node changed, how can I recover?
## The IP address of a node changed, how can I recover?
A node is required to have a static IP configured (or a reserved IP via DHCP). If the IP of a node has changed, you will have to remove it from the cluster and readd it. After it is removed, Rancher will update the cluster to the correct state. If the cluster is no longer in `Provisioning` state, the node is removed from the cluster.
@@ -93,11 +97,11 @@ When the IP address of the node changed, Rancher lost connection to the node, so
When the node is removed from the cluster, and the node is cleaned, you can readd the node to the cluster.
### How can I add more arguments/binds/environment variables to Kubernetes components in a Rancher Launched Kubernetes cluster?
## How can I add more arguments/binds/environment variables to Kubernetes components in a Rancher Launched Kubernetes cluster?
You can add more arguments/binds/environment variables via the [Config File](../reference-guides/cluster-configuration/rancher-server-configuration/rke1-cluster-configuration.md#rke-cluster-config-file-reference) option in Cluster Options. For more information, see the [Extra Args, Extra Binds, and Extra Environment Variables](https://rancher.com/docs/rke/latest/en/config-options/services/services-extras/) in the RKE documentation or browse the [Example Cluster.ymls](https://rancher.com/docs/rke/latest/en/example-yamls/).
### How do I check if my certificate chain is valid?
## How do I check if my certificate chain is valid?
Use the `openssl verify` command to validate your certificate chain:
@@ -138,7 +142,7 @@ subject= /C=GB/ST=England/O=Alice Ltd/CN=rancher.yourdomain.com
issuer= /C=GB/ST=England/O=Alice Ltd/CN=Alice Intermediate CA
```
### How do I check `Common Name` and `Subject Alternative Names` in my server certificate?
## How do I check `Common Name` and `Subject Alternative Names` in my server certificate?
Although technically an entry in `Subject Alternative Names` is required, having the hostname in both `Common Name` and as entry in `Subject Alternative Names` gives you maximum compatibility with older browser/applications.
@@ -156,7 +160,7 @@ openssl x509 -noout -in cert.pem -text | grep DNS
DNS:rancher.my.org
```
### Why does it take 5+ minutes for a pod to be rescheduled when a node has failed?
## Why does it take 5+ minutes for a pod to be rescheduled when a node has failed?
This is due to a combination of the following default Kubernetes settings:
@@ -175,6 +179,6 @@ In Kubernetes v1.13, the `TaintBasedEvictions` feature is enabled by default. Se
* `default-not-ready-toleration-seconds`: Indicates the tolerationSeconds of the toleration for notReady:NoExecute that is added by default to every pod that does not already have such a toleration.
* `default-unreachable-toleration-seconds`: Indicates the tolerationSeconds of the toleration for unreachable:NoExecute that is added by default to every pod that does not already have such a toleration.
### Can I use keyboard shortcuts in the UI?
## Can I use keyboard shortcuts in the UI?
Yes, most parts of the UI can be reached using keyboard shortcuts. For an overview of the available shortcuts, press `?` anywhere in the UI.
+4 -4
View File
@@ -6,11 +6,11 @@ title: Telemetry FAQ
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/faq/telemetry"/>
</head>
### What is Telemetry?
## What is Telemetry?
Telemetry collects aggregate information about the size of Rancher installations, versions of components used, and which features are used. This information is used by Rancher Labs to help make the product better and is not shared with third-parties.
### What information is collected?
## What information is collected?
No specific identifying information like usernames, passwords, or the names or addresses of user resources will ever be collected.
@@ -24,12 +24,12 @@ The primary things collected include:
- The image name & version of Rancher that is running.
- A unique randomly-generated identifier for this installation.
### Can I see the information that is being sent?
## Can I see the information that is being sent?
If Telemetry is enabled, you can go to `https://<your rancher server>/v1-telemetry` in your installation to see the current data.
If Telemetry is not enabled, the process that collects the data is not running, so there is nothing being collected to look at.
### How do I turn it on or off?
## How do I turn it on or off?
After initial setup, an administrator can go to the `Settings` page in the `Global` section of the UI and click Edit to change the `telemetry-opt` setting to either `in` or `out`.
@@ -49,7 +49,6 @@ For [air-gapped installs only,](../other-installation-methods/air-gapped-helm-cl
Follow the steps to upgrade Rancher server:
### 1. Back up Your Kubernetes Cluster that is Running Rancher Server
Use the [backup application](../../../how-to-guides/new-user-guides/backup-restore-and-disaster-recovery/back-up-rancher.md) to back up Rancher.
@@ -119,7 +118,6 @@ If you are installing Rancher in an air-gapped environment, skip the rest of thi
:::
Get the values, which were passed with `--set`, from the current Rancher Helm chart that is installed.
```
@@ -22,7 +22,7 @@ Starting with version 1.24, the above defaults to true.
For users looking to use another container runtime, Rancher has the edge-focused K3s and datacenter-focused RKE2 Kubernetes distributions that use containerd as the default runtime. Imported RKE2 and K3s Kubernetes clusters can then be upgraded and managed through Rancher going forward.
### FAQ
## FAQ
<br/>
@@ -28,7 +28,7 @@ For security purposes, SSL (Secure Sockets Layer) is required when using Rancher
Choose from the following options:
### Option A: Default Self-Signed Certificate
## Option A: Default Self-Signed Certificate
<details id="option-a">
<summary>Click to expand</summary>
@@ -55,7 +55,7 @@ docker run -d --restart=unless-stopped \
</details>
### Option B: Bring Your Own Certificate: Self-Signed
## Option B: Bring Your Own Certificate: Self-Signed
<details id="option-b">
<summary>Click to expand</summary>
@@ -98,7 +98,7 @@ docker run -d --restart=unless-stopped \
</details>
### Option C: Bring Your Own Certificate: Signed by Recognized CA
## Option C: Bring Your Own Certificate: Signed by Recognized CA
<details id="option-c">
<summary>Click to expand</summary>
@@ -143,8 +143,6 @@ docker run -d --restart=unless-stopped \
</details>
:::note
If you don't intend to send telemetry data, opt out [telemetry](../../../../faq/telemetry.md) during the initial login.
@@ -25,7 +25,7 @@ We recommend setting up the following infrastructure for a high-availability ins
- **A DNS record** to map a URL to the load balancer. This will become the Rancher server URL, and downstream Kubernetes clusters will need to reach it.
- **A private image registry** to distribute container images to your machines.
### 1. Set up Linux Nodes
## 1. Set up Linux Nodes
These hosts will be disconnected from the internet, but require being able to connect with your private registry.
@@ -33,7 +33,7 @@ Make sure that your nodes fulfill the general installation requirements for [OS,
For an example of one way to set up Linux nodes, refer to this [tutorial](../../../../how-to-guides/new-user-guides/infrastructure-setup/nodes-in-amazon-ec2.md) for setting up nodes as instances in Amazon EC2.
### 2. Set up External Datastore
## 2. Set up External Datastore
The ability to run Kubernetes using a datastore other than etcd sets K3s apart from other Kubernetes distributions. This feature provides flexibility to Kubernetes operators. The available options allow you to select a datastore that best fits your use case.
@@ -49,7 +49,7 @@ For an example of one way to set up the database, refer to this [tutorial](../..
For the complete list of options that are available for configuring a K3s cluster datastore, refer to the [K3s documentation.](https://rancher.com/docs/k3s/latest/en/installation/datastore/)
### 3. Set up the Load Balancer
## 3. Set up the Load Balancer
You will also need to set up a load balancer to direct traffic to the Rancher replica on both nodes. That will prevent an outage of any single node from taking down communications to the Rancher management server.
@@ -72,7 +72,7 @@ Do not use this load balancer (i.e, the `local` cluster Ingress) to load balance
:::
### 4. Set up the DNS Record
## 4. Set up the DNS Record
Once you have set up your load balancer, you will need to create a DNS record to send traffic to this load balancer.
@@ -82,7 +82,7 @@ You will need to specify this hostname in a later step when you install Rancher,
For a how-to guide for setting up a DNS record to route domain traffic to an Amazon ELB load balancer, refer to the [official AWS documentation.](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-elb-load-balancer)
### 5. Set up a Private Image Registry
## 5. Set up a Private Image Registry
Rancher supports air gap installs using a private registry. You must have your own private registry or other means of distributing container images to your machines.
@@ -106,13 +106,13 @@ To install the Rancher management server on a high-availability RKE cluster, we
These nodes must be in the same region/data center. You may place these servers in separate availability zones.
### Why three nodes?
## Why Three Nodes?
In an RKE cluster, Rancher server data is stored on etcd. This etcd database runs on all three nodes.
The etcd database requires an odd number of nodes so that it can always elect a leader with a majority of the etcd cluster. If the etcd database cannot elect a leader, etcd can suffer from [split brain](https://www.quora.com/What-is-split-brain-in-distributed-systems), requiring the cluster to be restored from backup. If one of the three etcd nodes fails, the two remaining nodes can elect a leader because they have the majority of the total number of etcd nodes.
### 1. Set up Linux Nodes
## 1. Set up Linux Nodes
These hosts will be disconnected from the internet, but require being able to connect with your private registry.
@@ -120,7 +120,7 @@ Make sure that your nodes fulfill the general installation requirements for [OS,
For an example of one way to set up Linux nodes, refer to this [tutorial](../../../../how-to-guides/new-user-guides/infrastructure-setup/nodes-in-amazon-ec2.md) for setting up nodes as instances in Amazon EC2.
### 2. Set up the Load Balancer
## 2. Set up the Load Balancer
You will also need to set up a load balancer to direct traffic to the Rancher replica on both nodes. That will prevent an outage of any single node from taking down communications to the Rancher management server.
@@ -143,7 +143,7 @@ Do not use this load balancer (i.e, the `local` cluster Ingress) to load balance
:::
### 3. Set up the DNS Record
## 3. Set up the DNS Record
Once you have set up your load balancer, you will need to create a DNS record to send traffic to this load balancer.
@@ -153,7 +153,7 @@ You will need to specify this hostname in a later step when you install Rancher,
For a how-to guide for setting up a DNS record to route domain traffic to an Amazon ELB load balancer, refer to the [official AWS documentation.](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-elb-load-balancer)
### 4. Set up a Private Image Registry
## 4. Set up a Private Image Registry
Rancher supports air gap installs using a secure private registry. You must have your own private registry or other means of distributing container images to your machines.
@@ -176,7 +176,7 @@ If you need to create a private registry, refer to the documentation pages for y
:::
### 1. Set up a Linux Node
## 1. Set up a Linux Node
This host will be disconnected from the Internet, but needs to be able to connect to your private registry.
@@ -184,7 +184,7 @@ Make sure that your node fulfills the general installation requirements for [OS,
For an example of one way to set up Linux nodes, refer to this [tutorial](../../../../how-to-guides/new-user-guides/infrastructure-setup/nodes-in-amazon-ec2.md) for setting up nodes as instances in Amazon EC2.
### 2. Set up a Private Docker Registry
## 2. Set up a Private Docker Registry
Rancher supports air gap installs using a private registry on your bastion server. You must have your own private registry or other means of distributing container images to your machines.
@@ -193,4 +193,4 @@ If you need help with creating a private registry, please refer to the [official
</TabItem>
</Tabs>
### [Next: Collect and Publish Images to your Private Registry](publish-images.md)
## [Next: Collect and Publish Images to your Private Registry](publish-images.md)
@@ -23,14 +23,15 @@ The steps to set up an air-gapped Kubernetes cluster on RKE, RKE2, or K3s are sh
In this guide, we are assuming you have created your nodes in your air gapped environment and have a secure Docker private registry on your bastion server.
### Installation Outline
## Installation Outline
1. [Prepare Images Directory](#1-prepare-images-directory)
2. [Create Registry YAML](#2-create-registry-yaml)
3. [Install K3s](#3-install-k3s)
4. [Save and Start Using the kubeconfig File](#4-save-and-start-using-the-kubeconfig-file)
### 1. Prepare Images Directory
## 1. Prepare Images Directory
Obtain the images tar file for your architecture from the [releases](https://github.com/k3s-io/k3s/releases) page for the version of K3s you will be running.
Place the tar file in the `images` directory before starting K3s on each node, for example:
@@ -40,7 +41,8 @@ sudo mkdir -p /var/lib/rancher/k3s/agent/images/
sudo cp ./k3s-airgap-images-$ARCH.tar /var/lib/rancher/k3s/agent/images/
```
### 2. Create Registry YAML
## 2. Create Registry YAML
Create the registries.yaml file at `/etc/rancher/k3s/registries.yaml`. This will tell K3s the necessary details to connect to your private registry.
The registries.yaml file should look like this before plugging in the necessary information:
@@ -66,7 +68,7 @@ Note, at this time only secure registries are supported with K3s (SSL with custo
For more information on private registries configuration file for K3s, refer to the [K3s documentation.](https://rancher.com/docs/k3s/latest/en/installation/private-registry/)
### 3. Install K3s
## 3. Install K3s
Rancher needs to be installed on a supported Kubernetes version. To find out which versions of Kubernetes are supported for your Rancher version, refer to the [Rancher Support Matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/).
@@ -98,7 +100,7 @@ K3s additionally provides a `--resolv-conf` flag for kubelets, which may help wi
:::
### 4. Save and Start Using the kubeconfig File
## 4. Save and Start Using the kubeconfig File
When you installed K3s on each Rancher server node, a `kubeconfig` file was created on the node at `/etc/rancher/k3s/k3s.yaml`. This file contains credentials for full access to the cluster, and you should save this file in a secure location.
@@ -138,7 +140,7 @@ kubectl --kubeconfig ~/.kube/config/k3s.yaml get pods --all-namespaces
For more information about the `kubeconfig` file, refer to the [K3s documentation](https://rancher.com/docs/k3s/latest/en/cluster-access/) or the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) about organizing cluster access using `kubeconfig` files.
### Note on Upgrading
## Note on Upgrading
Upgrading an air-gap environment can be accomplished in the following manner:
@@ -151,14 +153,15 @@ Upgrading an air-gap environment can be accomplished in the following manner:
In this guide, we are assuming you have created your nodes in your air-gapped environment and have a secure Docker private registry on your bastion server.
### Installation Outline
## Installation Outline
1. [Create RKE2 configuration](#1-create-rke2-configuration)
2. [Create Registry YAML](#2-create-registry-yaml)
3. [Install RKE2](#3-install-rke2)
4. [Save and Start Using the kubeconfig File](#4-save-and-start-using-the-kubeconfig-file)
### 1. Create RKE2 configuration
## 1. Create RKE2 configuration
Create the config.yaml file at `/etc/rancher/rke2/config.yaml`. This will contain all the configuration options necessary to create a highly available RKE2 cluster.
On the first server the minimum config is:
@@ -186,7 +189,8 @@ RKE2 additionally provides a `resolv-conf` option for kubelets, which may help w
:::
### 2. Create Registry YAML
## 2. Create Registry YAML
Create the registries.yaml file at `/etc/rancher/rke2/registries.yaml`. This will tell RKE2 the necessary details to connect to your private registry.
The registries.yaml file should look like this before plugging in the necessary information:
@@ -210,7 +214,7 @@ configs:
For more information on private registries configuration file for RKE2, refer to the [RKE2 documentation.](https://docs.rke2.io/install/containerd_registry_configuration)
### 3. Install RKE2
## 3. Install RKE2
Rancher needs to be installed on a supported Kubernetes version. To find out which versions of Kubernetes are supported for your Rancher version, refer to the [support maintenance terms.](https://rancher.com/support-maintenance-terms/)
@@ -239,7 +243,7 @@ systemctl start rke2-server.service
For more information, refer to the [RKE2 documentation](https://docs.rke2.io/install/airgap).
### 4. Save and Start Using the kubeconfig File
## 4. Save and Start Using the kubeconfig File
When you installed RKE2 on each Rancher server node, a `kubeconfig` file was created on the node at `/etc/rancher/rke2/rke2.yaml`. This file contains credentials for full access to the cluster, and you should save this file in a secure location.
@@ -279,7 +283,7 @@ kubectl --kubeconfig ~/.kube/config/rke2.yaml get pods --all-namespaces
For more information about the `kubeconfig` file, refer to the [RKE2 documentation](https://docs.rke2.io/cluster_access) or the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) about organizing cluster access using `kubeconfig` files.
### Note on Upgrading
## Note on Upgrading
Upgrading an air-gap environment can be accomplished in the following manner:
@@ -291,7 +295,7 @@ Upgrading an air-gap environment can be accomplished in the following manner:
<TabItem value="RKE">
We will create a Kubernetes cluster using Rancher Kubernetes Engine (RKE). Before being able to start your Kubernetes cluster, you’ll need to install RKE and create a RKE config file.
### 1. Install RKE
## 1. Install RKE
Install RKE by following the instructions in the [RKE documentation.](https://rancher.com/docs/rke/latest/en/installation/)
@@ -301,7 +305,7 @@ Certified version(s) of RKE based on the Rancher version can be found in the [Ra
:::
### 2. Create an RKE Config File
## 2. Create an RKE Config File
From a system that can access ports 22/TCP and 6443/TCP on the Linux host node(s) that you set up in a previous step, use the sample below to create a new file named `rancher-cluster.yml`.
@@ -352,7 +356,7 @@ private_registries:
is_default: true
```
### 3. Run RKE
## 3. Run RKE
After configuring `rancher-cluster.yml`, bring up your Kubernetes cluster:
@@ -360,7 +364,7 @@ After configuring `rancher-cluster.yml`, bring up your Kubernetes cluster:
rke up --config ./rancher-cluster.yml
```
### 4. Save Your Files
## 4. Save Your Files
:::note Important:
@@ -383,8 +387,8 @@ The "rancher-cluster" parts of the two latter file names are dependent on how yo
:::
### Issues or errors?
## Issues or Errors?
See the [Troubleshooting](../../install-upgrade-on-a-kubernetes-cluster/troubleshooting.md) page.
### [Next: Install Rancher](install-rancher-ha.md)
## [Next: Install Rancher](install-rancher-ha.md)
@@ -8,7 +8,7 @@ title: 4. Install Rancher
This section is about how to deploy Rancher for your air gapped environment in a high-availability Kubernetes installation. An air gapped environment could be where Rancher server will be installed offline, behind a firewall, or behind a proxy.
### Privileged Access for Rancher
## Privileged Access for Rancher
When the Rancher server is deployed in the Docker container, a local Kubernetes cluster is installed within the container for Rancher to use. Because many features of Rancher run as deployments, and privileged mode is required to run containers within containers, you will need to install Rancher with the `--privileged` option.
@@ -92,7 +92,7 @@ Recent changes to cert-manager require an upgrade. If you are upgrading Rancher
:::
##### 1. Add the cert-manager repo
##### 1. Add the cert-manager Repo
From a system connected to the internet, add the cert-manager repo to Helm:
@@ -101,7 +101,7 @@ helm repo add jetstack https://charts.jetstack.io
helm repo update
```
##### 2. Fetch the cert-manager chart
##### 2. Fetch the cert-manager Chart
Fetch the latest cert-manager chart available from the [Helm chart repository](https://artifacthub.io/packages/helm/cert-manager/cert-manager).
@@ -109,7 +109,7 @@ Fetch the latest cert-manager chart available from the [Helm chart repository](h
helm fetch jetstack/cert-manager --version v1.11.0
```
##### 3. Retrieve the Cert-Manager CRDs
##### 3. Retrieve the cert-manager CRDs
Download the required CRD file for cert-manager:
```plain
@@ -120,7 +120,7 @@ Download the required CRD file for cert-manager:
Copy the fetched charts to a system that has access to the Rancher server cluster to complete installation.
##### 1. Install Cert-Manager
#### 1. Install cert-manager
Install cert-manager with the same options you would use to install the chart. Remember to set the `image.repository` option to pull the image from your private registry.
@@ -160,7 +160,8 @@ If you are using self-signed certificates, install cert-manager:
</details>
##### 2. Install Rancher
#### 2. Install Rancher
First, refer to [Adding TLS Secrets](../../resources/add-tls-secrets.md) to publish the certificate files so Rancher and the ingress controller can use them.
Then, create the namespace for Rancher using kubectl:
@@ -192,9 +193,9 @@ Placeholder | Description
**Optional**: To install a specific Rancher version, set the `rancherImageTag` value, example: `--set rancherImageTag=v2.5.8`
#### Option B: Certificates From Files using Kubernetes Secrets
#### Option B: Certificates From Files Using Kubernetes Secrets
##### 1. Create secrets
##### 1. Create Secrets
Create Kubernetes secrets from your own certificates for Rancher to use. The common name for the cert will need to match the `hostname` option in the command below, or the ingress controller will fail to provision the site for Rancher.
@@ -36,7 +36,7 @@ Administrators might configure the RKE metadata settings to do the following:
- Change the metadata URL that Rancher uses to sync the metadata, which is useful for air gap setups if you need to sync Rancher locally instead of with GitHub
- Prevent Rancher from auto-syncing the metadata, which is one way to prevent new and unsupported Kubernetes versions from being available in Rancher
### Refresh Kubernetes Metadata
## Refresh Kubernetes Metadata
The option to refresh the Kubernetes metadata is available for administrators by default, or for any user who has the **Manage Cluster Drivers** [global role.](../../how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/global-permissions.md)
@@ -74,7 +74,7 @@ If you don't have an air gap setup, you don't need to specify the URL where Ranc
However, if you have an [air gap setup,](#air-gap-setups) you will need to mirror the Kubernetes metadata repository in a location available to Rancher. Then you need to change the URL to point to the new location of the JSON file.
### Air Gap Setups
## Air Gap Setups
Rancher relies on a periodic refresh of the `rke-metadata-config` to download new Kubernetes version metadata if it is supported with the current version of the Rancher server. For a table of compatible Kubernetes and Rancher versions, refer to the [service terms section.](https://rancher.com/support-maintenance-terms/all-supported-versions/rancher-v2.2.8/)
@@ -80,11 +80,11 @@ If you use a certificate signed by a recognized CA, installing your certificate
1. Enter the following command.
```
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
rancher/rancher:latest --no-cacerts
```
```
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
rancher/rancher:latest --no-cacerts
```
</details>
@@ -10,7 +10,7 @@ When Rancher is used to manage [a large infrastructure](../../getting-started/in
The etcd data set is automatically cleaned up on a five minute interval by Kubernetes. There are situations, e.g. deployment thrashing, where enough events could be written to etcd and deleted before garbage collection occurs and cleans things up causing the keyspace to fill up. If you see `mvcc: database space exceeded` errors, in the etcd logs or Kubernetes API server logs, you should consider increasing the keyspace size. This can be accomplished by setting the [quota-backend-bytes](https://etcd.io/docs/v3.5/op-guide/maintenance/#space-quota) setting on the etcd servers.
### Example: This snippet of the RKE cluster.yml file increases the keyspace size to 5GB
## Example: This Snippet of the RKE Cluster.yml file Increases the Keyspace Size to 5GB
```yaml
# RKE cluster.yml
@@ -21,7 +21,7 @@ services:
quota-backend-bytes: 5368709120
```
## Scaling etcd disk performance
## Scaling etcd Disk Performance
You can follow the recommendations from [the etcd docs](https://etcd.io/docs/v3.5/tuning/#disk) on how to tune the disk priority on the host.
@@ -60,4 +60,4 @@ To convert an existing cluster to use an RKE template,
- A new RKE template is created.
- The cluster is converted to use the new template.
- New clusters can be [created from the new template.](apply-templates.md#creating-a-cluster-from-an-rke-template)
- New clusters can be [created from the new template.](#creating-a-cluster-from-an-rke-template)
@@ -69,7 +69,7 @@ To view Helm charts in the OCI-based Helm chart repository after it achieves an
Rancher automatically refreshes the OCI-based Helm chart repository every 6 hours.
If you need to update immediately, you can [perform a manual refresh](../helm-charts-in-rancher/helm-charts-in-rancher.md#refresh-chart-repositories).
If you need to update immediately, you can [perform a manual refresh](./helm-charts-in-rancher.md#refresh-chart-repositories).
## Update an OCI-Based Helm Chart Repository Configuration
@@ -23,7 +23,7 @@ You need a separate kubeconfig file for each cluster that you have access to in
After you download the kubeconfig file, you are able to use the kubeconfig file and its Kubernetes [contexts](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration) to access your downstream cluster.
If admins have [kubeconfig token generation turned off](../../../../api/api-tokens.md#disable-tokens-in-generated-kubeconfigs), the kubeconfig file requires that the [Rancher CLI](./authorized-cluster-endpoint.md) to be present in your PATH.
If admins have [kubeconfig token generation turned off](../../../../api/api-tokens.md#disable-tokens-in-generated-kubeconfigs), the kubeconfig file requires that the [Rancher CLI](../../../../reference-guides/cli-with-rancher/rancher-cli.md) to be present in your PATH.
### Two Authentication Methods for RKE Clusters
@@ -173,12 +173,12 @@ To add members:
### 4. Optional: Add Resource Quotas
Resource quotas limit the resources that a project (and its namespaces) can consume. For more information, see [Resource Quotas](projects-and-namespaces.md).
Resource quotas limit the resources that a project (and its namespaces) can consume. For more information, see [Resource Quotas](../../advanced-user-guides/manage-projects/manage-project-resource-quotas/manage-project-resource-quotas.md).
To add a resource quota,
1. In the **Resource Quotas** tab, click **Add Resource**.
1. Select a **Resource Type**. For more information, see [Resource Quotas.](projects-and-namespaces.md).
1. Select a **Resource Type**. For more information, see [Resource Quotas.](../../advanced-user-guides/manage-projects/manage-project-resource-quotas/manage-project-resource-quotas.md).
1. Enter values for the **Project Limit** and the **Namespace Default Limit**.
1. **Optional:** Specify **Container Default Resource Limit**, which will be applied to every container started in the project. The parameter is recommended if you have CPU or Memory limits set by the Resource Quota. It can be overridden on per an individual namespace or a container level. For more information, see [Container Default Resource Limit](../../advanced-user-guides/manage-projects/manage-project-resource-quotas/manage-project-resource-quotas.md)
1. Click **Create**.
@@ -25,11 +25,11 @@ To manage permissions in a vanilla Kubernetes cluster, cluster admins configure
:::note
If you create a namespace with `kubectl`, it may be unusable because `kubectl` doesn't require your new namespace to be scoped within a project that you have access to. If your permissions are restricted to the project level, it is better to [create a namespace through Rancher](manage-namespaces.md) to ensure that you will have permission to access the namespace.
If you create a namespace with `kubectl`, it may be unusable because `kubectl` doesn't require your new namespace to be scoped within a project that you have access to. If your permissions are restricted to the project level, it is better to [create a namespace through Rancher](#creating-namespaces) to ensure that you will have permission to access the namespace.
:::
### Creating Namespaces
## Creating Namespaces
Create a new namespace to isolate apps and resources in a project.
@@ -50,7 +50,7 @@ When working with project resources that you can assign to a namespace (i.e., [w
**Result:** Your namespace is added to the project. You can begin assigning cluster resources to the namespace.
### Moving Namespaces to Another Project
## Moving Namespaces to Another Project
Cluster admins and members may occasionally need to move a namespace to another project, such as when you want a different team to start using the application.
@@ -71,7 +71,7 @@ Cluster admins and members may occasionally need to move a namespace to another
**Result:** Your namespace is moved to a different project (or is unattached from all projects). If any project resources are attached to the namespace, the namespace releases them and then attached resources from the new project.
### Editing Namespace Resource Quotas
## Editing Namespace Resource Quotas
You can always override the namespace default limit to provide a specific namespace with access to more (or less) project resources.
@@ -18,7 +18,8 @@ In order to deploy and run the adapter successfully, you need to ensure its vers
:::
| Rancher Version | Adapter Version |
|-----------------|:----------------:|
|-----------------|------------------|
| v2.9.2 | v104.0.0+up4.0.0 |
| v2.9.1 | v104.0.0+up4.0.0 |
| v2.9.0 | v104.0.0+up4.0.0 |
@@ -12,7 +12,7 @@ These bundles can be created through Rancher or through direct access to the clu
> **Note:** Only admin users can generate/download supportconfig bundles, regardless of method.
## Accessing through Rancher
## Accessing Through Rancher
First, click on the hamburger menu. Then click the `Get Support` button.
@@ -24,7 +24,7 @@ In the next page, click on the `Generate Support Config` button.
![Get Support](/img/generate-support-config.png)
## Accessing without Rancher
## Accessing Without Rancher
First, generate a kubeconfig for the cluster that Rancher is installed on.
@@ -45,7 +45,7 @@ To configure the resources allocated to an Istio component,
1. In the left navigation bar, click **Apps**.
1. Click **Installed Apps**.
1. Go to the `istio-system` namespace. In one of the Istio workloads, such as `rancher-istio`, click **⋮ > Edit/Upgrade**.
1. Click **Upgrade** to edit the base components via changes to the values.yaml or add an [overlay file](configuration-options/configuration-options.md#overlay-file). For more information about editing the overlay file, see [this section.](cpu-and-memory-allocations.md#editing-the-overlay-file)
1. Click **Upgrade** to edit the base components via changes to the values.yaml or add an [overlay file](configuration-options/configuration-options.md#overlay-file). For more information about editing the overlay file, see [this section.](#editing-the-overlay-file)
1. Change the CPU or memory allocations, the nodes where each component will be scheduled to, or the node tolerations.
1. Click **Upgrade**. to rollout changes
@@ -97,7 +97,6 @@ To be able to fully deploy Monitoring V2 for Windows, all of your Windows hosts
For more details on how to upgrade wins on existing Windows hosts, see [Windows cluster support for Monitoring V2.](windows-support.md).
## Known Issues
There is a [known issue](https://github.com/rancher/rancher/issues/28787#issuecomment-693611821) that K3s clusters require more than the allotted default memory. If you enable monitoring on a K3s cluster, set `prometheus.prometheusSpec.resources.memory.limit` to 2500 Mi and `prometheus.prometheusSpec.resources.memory.request` to 1750 Mi.
@@ -6,8 +6,6 @@ title: Overview
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/integrations-in-rancher/neuvector/overview"/>
</head>
## NeuVector Integration in Rancher
[NeuVector 5.x](https://open-docs.neuvector.com/) is an open-source container-centric security platform that is integrated with Rancher. NeuVector offers real-time compliance, visibility, and protection for critical applications and data during runtime. NeuVector provides a firewall, container process/file system monitoring, security auditing with CIS benchmarks, and vulnerability scanning. For more information on Rancher security, please see the [security documentation](../../reference-guides/rancher-security/rancher-security.md).
NeuVector can be enabled through a Helm chart that may be installed either through **Apps** or through the **Cluster Tools** button in the Rancher UI. Once the Helm chart is installed, users can easily [deploy and manage NeuVector clusters within Rancher](https://open-docs.neuvector.com/deploying/rancher#deploy-and-manage-neuvector-through-rancher-apps-marketplace).
@@ -183,7 +181,6 @@ kubectl patch cronjob neuvector-updater-pod -n cattle-neuvector-system --patch '
- All NeuVector components are deployable on a cluster in an air-gapped environment without any additional configuration needed.
## Support Limitations
* Only admins and cluster owners are currently supported.
@@ -192,7 +189,6 @@ kubectl patch cronjob neuvector-updater-pod -n cattle-neuvector-system --patch '
* NeuVector is not supported on a Windows cluster.
## Other Limitations
* Currently, NeuVector feature chart installation fails when a NeuVector partner chart already exists. To work around this issue, uninstall the NeuVector partner chart and reinstall the NeuVector feature chart.
@@ -9,7 +9,7 @@ description: Interact with Rancher using command line interface (CLI) tools from
The Rancher CLI (Command Line Interface) is a unified tool that you can use to interact with Rancher. With this tool, you can operate Rancher using a command line rather than the GUI.
### Download Rancher CLI
## Download Rancher CLI
The binary can be downloaded directly from the UI.
@@ -17,14 +17,14 @@ The binary can be downloaded directly from the UI.
1. At the bottom of the navigation sidebar menu, click **About**.
1. Under the **CLI Downloads section**, there are links to download the binaries for Windows, Mac, and Linux. You can also check the [releases page for our CLI](https://github.com/rancher/cli/releases) for direct downloads of the binary.
### Requirements
## Requirements
After you download the Rancher CLI, you need to make a few configurations. Rancher CLI requires:
- Your Rancher Server URL, which is used to connect to Rancher Server.
- An API Bearer Token, which is used to authenticate with Rancher. For more information about obtaining a Bearer Token, see [Creating an API Key](../user-settings/api-keys.md).
### CLI Authentication
## CLI Authentication
Before you can use Rancher CLI to control your Rancher Server, you must authenticate using an API Bearer Token. Log in using the following command (replace `<BEARER_TOKEN>` and `<SERVER_URL>` with your information):
@@ -34,7 +34,7 @@ $ ./rancher login https://<SERVER_URL> --token <BEARER_TOKEN>
If Rancher Server uses a self-signed certificate, Rancher CLI prompts you to continue with the connection.
### Project Selection
## Project Selection
Before you can perform any commands, you must select a Rancher project to perform those commands against. To select a [project](../../how-to-guides/new-user-guides/manage-clusters/projects-and-namespaces.md) to work on, use the command `./rancher context switch`. When you enter this command, a list of available projects displays. Enter a number to choose your project.
@@ -58,7 +58,7 @@ INFO[0005] Saving config to /Users/markbishop/.ranchcli2.json
Ensure you can run `rancher kubectl get pods` successfully.
### Commands
## Commands
The following commands are available for use in Rancher CLI.
@@ -86,12 +86,12 @@ The following commands are available for use in Rancher CLI.
| `token` | Authenticates and generates new kubeconfig token. |
| `help, [h]` | Shows a list of commands or help for one command. |
### Rancher CLI Help
## Rancher CLI Help
Once logged into Rancher Server using the CLI, enter `./rancher --help` for a list of commands.
All commands accept the `--help` flag, which documents each command's usage.
### Limitations
## Limitations
The Rancher CLI **cannot** be used to install [dashboard apps or Rancher feature charts](../../how-to-guides/new-user-guides/helm-charts-in-rancher/helm-charts-in-rancher.md).
@@ -10,7 +10,7 @@ After you provision a Kubernetes cluster using Rancher, you can still edit optio
For information on editing cluster membership, go to [this page.](../../how-to-guides/new-user-guides/manage-clusters/access-clusters/add-users-to-clusters.md)
### Cluster Configuration References
## Cluster Configuration References
The cluster configuration options depend on the type of Kubernetes cluster:
@@ -21,7 +21,7 @@ The cluster configuration options depend on the type of Kubernetes cluster:
- [GKE Cluster Configuration](rancher-server-configuration/gke-cluster-configuration/gke-cluster-configuration.md)
- [AKS Cluster Configuration](rancher-server-configuration/aks-cluster-configuration.md)
### Cluster Management Capabilities by Cluster Type
## Cluster Management Capabilities by Cluster Type
The options and settings available for an existing cluster change based on the method that you used to provision it.
@@ -6,15 +6,15 @@ title: Monitoring Configuration Examples
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/reference-guides/monitoring-v2-configuration/examples"/>
</head>
### ServiceMonitor
## ServiceMonitor
See the official prometheus-operator GitHub repo for an example [ServiceMonitor](https://github.com/prometheus-operator/prometheus-operator/blob/master/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml) YAML.
### PodMonitor
## PodMonitor
See the [Prometheus Operator documentation](https://prometheus-operator.dev/docs/user-guides/getting-started/#using-podmonitors) for an example PodMonitor and an example Prometheus resource that refers to a PodMonitor.
### PrometheusRule
## PrometheusRule
A PrometheusRule contains the alerting and recording rules that you would usually place in a [Prometheus rule file](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/).
@@ -22,6 +22,6 @@ For a more fine-grained approach, the `ruleSelector` field on a Prometheus resou
See the [Prometheus Operator documentation](https://prometheus-operator.dev/docs/user-guides/alerting/) for an example PrometheusRule.
### Alertmanager Config
## Alertmanager Config
See the Rancher docs page on Receivers for an example [Alertmanager config](./receivers.md#example-alertmanager-configs).
@@ -18,7 +18,7 @@ This section assumes familiarity with how monitoring components work together. F
:::
### ServiceMonitors
## ServiceMonitors
This pseudo-CRD maps to a section of the Prometheus custom resource configuration. It declaratively specifies how groups of Kubernetes services should be monitored.
@@ -28,7 +28,7 @@ Any Services in your cluster that match the labels located within the ServiceMon
For more information about how ServiceMonitors work, refer to the [Prometheus Operator documentation.](https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/running-exporters.md)
### PodMonitors
## PodMonitors
This pseudo-CRD maps to a section of the Prometheus custom resource configuration. It declaratively specifies how group of pods should be monitored.
+1
View File
@@ -20,6 +20,7 @@ Each Rancher version is designed to be compatible with a single version of the w
| Rancher Version | Webhook Version | Availability in Prime | Availability in Community |
|-----------------|-----------------|-----------------------|---------------------------|
| v2.9.2 | v0.5.2 | &check; | &check; |
| v2.9.1 | v0.5.1 | &check; | &check; |
| v2.9.0 | v0.5.0 | &cross; | &check; |
@@ -12,7 +12,7 @@ Make sure you configured the correct kubeconfig (for example, `export KUBECONFIG
Before running the DNS checks, check the [default DNS provider](../../reference-guides/cluster-configuration/rancher-server-configuration/rke1-cluster-configuration.md#default-dns-provider) for your cluster and make sure that [the overlay network is functioning correctly](networking.md#check-if-overlay-network-is-functioning-correctly) as this can also be the reason why DNS resolution (partly) fails.
### Check if DNS pods are running
## Check if DNS pods are running
```
kubectl -n kube-system get pods -l k8s-app=kube-dns
@@ -30,7 +30,7 @@ NAME READY STATUS RESTARTS AGE
kube-dns-5fd74c7488-h6f7n 3/3 Running 0 4m13s
```
### Check if the DNS service is present with the correct cluster-ip
## Check if the DNS service is present with the correct cluster-ip
```
kubectl -n kube-system get svc -l k8s-app=kube-dns
@@ -41,7 +41,7 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kube-dns ClusterIP 10.43.0.10 <none> 53/UDP,53/TCP 4m13s
```
### Check if domain names are resolving
## Check if domain names are resolving
Check if internal cluster names are resolving (in this example, `kubernetes.default`), the IP shown after `Server:` should be the same as the `CLUSTER-IP` from the `kube-dns` service.
@@ -132,15 +132,15 @@ command terminated with exit code 1
Cleanup the alpine DaemonSet by running `kubectl delete ds/dnstest`.
### CoreDNS specific
## CoreDNS specific
#### Check CoreDNS logging
### Check CoreDNS logging
```
kubectl -n kube-system logs -l k8s-app=kube-dns
```
#### Check configuration
### Check configuration
CoreDNS configuration is stored in the configmap `coredns` in the `kube-system` namespace.
@@ -148,7 +148,7 @@ CoreDNS configuration is stored in the configmap `coredns` in the `kube-system`
kubectl -n kube-system get configmap coredns -o go-template={{.data.Corefile}}
```
#### Check upstream nameservers in resolv.conf
### Check upstream nameservers in resolv.conf
By default, the configured nameservers on the host (in `/etc/resolv.conf`) will be used as upstream nameservers for CoreDNS. You can check this file on the host or run the following Pod with `dnsPolicy` set to `Default`, which will inherit the `/etc/resolv.conf` from the host it is running on.
@@ -156,7 +156,7 @@ By default, the configured nameservers on the host (in `/etc/resolv.conf`) will
kubectl run -i --restart=Never --rm test-${RANDOM} --image=ubuntu --overrides='{"kind":"Pod", "apiVersion":"v1", "spec": {"dnsPolicy":"Default"}}' -- sh -c 'cat /etc/resolv.conf'
```
#### Enable query logging
### Enable query logging
Enabling query logging can be done by enabling the [log plugin](https://coredns.io/plugins/log/) in the Corefile configuration in the configmap `coredns`. You can do so by using `kubectl -n kube-system edit configmap coredns` or use the command below to replace the configuration in place:
@@ -166,9 +166,9 @@ kubectl get configmap -n kube-system coredns -o json | sed -e 's_loadbalance_log
All queries will now be logged and can be checked using the command in [Check CoreDNS logging](#check-coredns-logging).
### kube-dns specific
## kube-dns specific
#### Check upstream nameservers in kubedns container
### Check upstream nameservers in kubedns container
By default, the configured nameservers on the host (in `/etc/resolv.conf`) will be used as upstream nameservers for kube-dns. Sometimes the host will run a local caching DNS nameserver, which means the address in `/etc/resolv.conf` will point to an address in the loopback range (`127.0.0.0/8`) which will be unreachable by the container. In case of Ubuntu 18.04, this is done by `systemd-resolved`. We detect if `systemd-resolved` is running, and will automatically use the `/etc/resolv.conf` file with the correct upstream nameservers (which is located at `/run/systemd/resolve/resolv.conf`).
@@ -6,7 +6,7 @@ title: API 令牌
要停用 API 令牌,你可以删除令牌或停用用户账号。
### 删除令牌
## 删除令牌
要删除令牌:
1. 转到 `https://<Rancher-Server-IP>/v3/tokens`,在 Rancher API 视图中查看包含所有令牌的列表。
@@ -28,7 +28,7 @@ title: API 令牌
| `drain-node-*` | 用于清空的令牌(由于没有原生 Kubernetes API,我们使用 `kubectl` 来清空) |
### 在 Kubeconfig 令牌上设置 TTL
## 在 Kubeconfig 令牌上设置 TTL
管理员可以在 Kubeconfig 令牌上设置全局存活时间 (time-to-live,TTL)。如需更改默认 kubeconfig TTL,你可以导航到全局设置并将 [`kubeconfig-default-token-ttl-minutes`](#kubeconfig-default-token-ttl-minutes) 设置为所需的持续时间(单位:分钟)。[`kubeconfig-default-token-ttl-minutes`](#kubeconfig-default-token-ttl-minutes) 的默认值为 0,表示令牌永不过期。
@@ -38,17 +38,17 @@ title: API 令牌
:::
### 在生成的 Kubeconfig 中禁用令牌
## 在生成的 Kubeconfig 中禁用令牌
1. 将 `kubeconfig-generate-token` 设置为 `false`。此设置让 Rancher 不再在用户单击下载 kubeconfig 文件时自动生成令牌。如果停用此设置,生成的 kubeconfig 将引用 [Rancher CLI](../cli-with-rancher/kubectl-utility.md#使用-kubectl-和-kubeconfig-令牌进行-ttl-认证) 来检索集群的短期令牌。当这个 kubeconfig 在客户端(例如 `kubectl`)中使用时,你需要安装 Rancher CLI 来完成登录请求。
1. 将 `kubeconfig-generate-token` 设置为 `false`。此设置让 Rancher 不再在用户单击下载 kubeconfig 文件时自动生成令牌。如果停用此设置,生成的 kubeconfig 将引用 [Rancher CLI](../reference-guides/cli-with-rancher/kubectl-utility.md#使用-kubectl-和-kubeconfig-令牌进行-ttl-认证) 来检索集群的短期令牌。当这个 kubeconfig 在客户端(例如 `kubectl`)中使用时,你需要安装 Rancher CLI 来完成登录请求。
2. 将 `kubeconfig-token-ttl-minutes` 设置为所需的时长(单位:分钟)。`kubeconfig-token-ttl-minutes` 默认设置为 960(即 16 小时)。
### 令牌哈希
## 令牌哈希
你可以启用令牌哈希,令牌将使用 SHA256 算法进行单向哈希。这是一个不可逆的操作,一旦启用,此功能将无法禁用。在启用功能或在测试环境中评估之前,建议你先进行备份。
要启用令牌哈希,请参阅[本节](../../pages-for-subheaders/enable-experimental-features.md)。
要启用令牌哈希,请参阅[本节](../how-to-guides/advanced-user-guides/enable-experimental-features/enable-experimental-features.md)。
此功能将影响所有令牌,包括但不限于以下内容:
@@ -56,7 +56,8 @@ title: API 令牌
- 持有者令牌 API 密钥/调用
- 内部操作使用的令牌
### 令牌设置
## 令牌设置
以下全局设置会影响 Rancher 令牌的行为:
| 设置 | 描述 |
@@ -67,20 +68,20 @@ title: API 令牌
| [`auth-token-max-ttl-minutes`](#auth-token-max-ttl-minutes) | 除了由 [`auth-user-session-ttl-minutes`](#auth-user-session-ttl-minutes) 控制的令牌外,所有令牌的最大 TTL。 |
| [`kubeconfig-generate-token`](#kubeconfig-generate-token) | 如果为 true,则在用户下载 kubeconfig 时自动生成令牌。 |
#### auth-user-session-ttl-minutes
### auth-user-session-ttl-minutes
存活时间(TTL)(单位:分钟),用于确定用户身份验证会话令牌的到期时间。过期后,用户将需要登录并获取新令牌。此设置不受 [`auth-token-max-ttl-minutes`](#auth-token-max-ttl-minutes) 的影响。会话令牌是在用户登录 Rancher 时创建的。
#### kubeconfig-default-token-TTL-minutes
### kubeconfig-default-token-TTL-minutes
存活时间(TTL)(单位:分钟),用于确定 kubeconfig 令牌的到期时间。令牌过期后,API 将拒绝令牌。此设置的值不能大于 [`auth-token-max-ttl-minutes`](#auth-token-max-ttl-minutes) 的值。此设置适用于在请求的 kubeconfig 文件中生成的令牌,不包括[由 Rancher CLI 生成的](#在生成的-kubeconfig-中禁用令牌)令牌。
**此设置从 2.6.6 版本开始引入**。
#### kubeconfig-token-ttl-minutes
### kubeconfig-token-ttl-minutes
存活时间(TTL)(单位:分钟),用于确定由 CLI 生成的 kubeconfig 令牌的到期时间。当 [`kubeconfig-generate-token`](#kubeconfig-generate-token) 设为 false 时,则由 CLI 生成令牌。令牌过期后,API 将拒绝令牌。此设置的值不能大于 [`auth-token-max-ttl-minutes`](#auth-token-max-ttl-minutes) 的值。
**自版本 2.6.6 起已弃用,并将在 2.8.0 中删除。请知悉,此设置将被 [`kubeconfig-default-token-TTL-minutes`](#kubeconfig-default-token-ttl-minutes) 的值替换**。
#### auth-token-max-ttl-minutes
### auth-token-max-ttl-minutes
身份验证令牌的最大生存时间 (TTL)(单位:分钟)。如果用户尝试创建一个 TTL 大于 `auth-token-max-ttl-minutes` 的令牌,Rancher 会将令牌 TTL 设置为 `auth-token-max-ttl-minutes` 的值。身份验证令牌是为验证 API 请求而创建的。
**2.6.6 版本更改:适用于所有 kubeconfig 令牌和 API 令牌。**
#### kubeconfig-generate-token
如果设置为 true,则通过 UI 请求的 kubeconfig 将包含一个有效的令牌。如果设置为 false,kubeconfig 将包含一个使用 Rancher CLI 提示用户登录的命令。然后,[CLI 将为用户检索和缓存令牌](../cli-with-rancher/kubectl-utility.md#使用-kubectl-和-kubeconfig-令牌进行-ttl-认证)。
### kubeconfig-generate-token
如果设置为 true,则通过 UI 请求的 kubeconfig 将包含一个有效的令牌。如果设置为 false,kubeconfig 将包含一个使用 Rancher CLI 提示用户登录的命令。然后,[CLI 将为用户检索和缓存令牌](../reference-guides/cli-with-rancher/kubectl-utility.md#使用-kubectl-和-kubeconfig-令牌进行-ttl-认证)。
@@ -27,7 +27,7 @@ API 有自己的用户界面,你可以从 Web 浏览器访问它。这是查
## 认证
API 请求必须包含认证信息。认证是通过 [API 密钥](../user-settings/api-keys.md)使用 HTTP 基本认证完成的。API 密钥可以创建新集群并通过 `/v3/clusters/` 访问多个集群。[集群和项目角色](../../how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/cluster-and-project-roles.md)会应用于这些键,并限制账号可以查看的集群和项目以及可以执行的操作。
API 请求必须包含认证信息。认证是通过 [API 密钥](../reference-guides/user-settings/api-keys.md)使用 HTTP 基本认证完成的。API 密钥可以创建新集群并通过 `/v3/clusters/` 访问多个集群。[集群和项目角色](../how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/cluster-and-project-roles.md)会应用于这些键,并限制账号可以查看的集群和项目以及可以执行的操作。
默认情况下,某些集群级别的 API 令牌是使用无限期 TTL(`ttl=0`)生成的。换言之,除非你让令牌失效,否则 `ttl=0` 的 API 令牌永远不会过期。有关如何使 API 令牌失效的详细信息,请参阅 [API 令牌](api-tokens.md)。
@@ -2,11 +2,11 @@
title: Rancher 弃用的功能
---
### Rancher 的弃用策略是什么?
## Rancher 的弃用策略是什么?
我们在支持[服务条款](https://rancher.com/support-maintenance-terms)中发布了官方弃用策略。
### 在哪里可以找到 Rancher 已弃用的功能?
## 在哪里可以找到 Rancher 已弃用的功能?
Rancher 会在 GitHub 上的[发行说明](https://github.com/rancher/rancher/releases)中公布已弃用的功能。请参阅以下补丁版本了解已弃用的功能:
@@ -20,7 +20,6 @@ Rancher 会在 GitHub 上的[发行说明](https://github.com/rancher/rancher/re
| [2.6.5](https://github.com/rancher/rancher/releases/tag/v2.6.5) | 2022 年 5 月 12 日 |
| [2.6.6](https://github.com/rancher/rancher/releases/tag/v2.6.6) | 2022 年 6 月 30 日 |
## 如果某个功能标记为弃用,我要怎么做?
### 如果某个功能标记为弃用,我要怎么做?
如果某个发行版将某功能标记为"Deprecated"(已弃用),该功能仍然可用并受支持,从而允许用户按照常规流程进行升级。在升级到该功能被标记为"已删除"的发行版前,用户/管理员应该计划剥离该功能。对于新部署,我们建议不要使用已弃用的功能。
如果某个发行版将某功能标记为"Deprecated"(已弃用),该功能仍然可用并受支持,从而允许用户按照常规流程进行升级。在升级到该功能被标记为"已删除"的发行版前,用户/管理员应该计划剥离该功能。对于新部署,我们建议不要使用已弃用的功能。
@@ -6,11 +6,11 @@ title: Rancher 中已弃用的功能
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/zh/faq/deprecated-features"/>
</head>
### Rancher 的弃用策略是什么?
## Rancher 的弃用策略是什么?
我们已经在支持的[服务条款](https://rancher.com/support-maintenance-terms)中发布了官方的弃用策略。
### 在哪里可以了解 Rancher 中已弃用哪些功能?
## 在哪里可以了解 Rancher 中已弃用哪些功能?
Rancher 将在 GitHub 上发布的 Rancher 的[发版说明](https://github.com/rancher/rancher/releases)中发布已弃用的功能。有关已弃用的功能,请参阅以下的补丁版本:
@@ -21,6 +21,6 @@ Rancher 将在 GitHub 上发布的 Rancher 的[发版说明](https://github.com/
| [2.8.1](https://github.com/rancher/rancher/releases/tag/v2.8.1) | 2024 年 1 月 22 日 |
| [2.8.0](https://github.com/rancher/rancher/releases/tag/v2.8.0) | 2023 年 12 月 6 日 |
### 当一个功能被标记为弃用我可以得到什么样的预期?
## 当一个功能被标记为弃用我可以得到什么样的预期?
当功能被标记为“已弃用”时,它依然可用并得到支持,允许按照常规的流程进行升级。一旦升级完成,用户/管理员应开始计划在升级到标记为已移除的版本之前放弃使用已弃用的功能。对于新的部署,建议不要使用已弃用的功能。
@@ -14,19 +14,19 @@ enable_cri_dockerd: true
如果你想使用其他容器运行时,Rancher 也提供使用 Containerd 作为默认运行时的,以边缘为中心的 K3s,和以数据中心为中心的 RKE2 Kubernetes 发行版。即使在 Kubernetes 1.24 删除了树内 Dockershim 之后,你也可以通过 Rancher 升级和管理导入的 RKE2 和 K3s Kubernetes 集群。
### 常见问题
## 常见问题
<br/>
Q. 如果要获得 Rancher 对上游 Dockershim 的支持,我需要升级 Rancher 吗?
Q: 如果要获得 Rancher 对上游 Dockershim 的支持,我需要升级 Rancher 吗?
对于 RKE,Dockershim 的上游支持从 Kubernetes 1.21 开始。你需要使用 Rancher 2.6 或更高版本才能获取使用 Kubernetes 1.21 的 RKE 的支持。详情请参阅我们的[支持矩阵](https://rancher.com/support-maintenance-terms/all-supported-versions/rancher-v2.6.0/)。
<br/>
Q. 我目前的 RKE 使用 Kubernetes 1.20。为了避免出现不再支持 Dockershim 的情况,我是否需要尽早将 RKE 升级到 Kubernetes 1.21?
Q: 我目前的 RKE 使用 Kubernetes 1.20。为了避免出现不再支持 Dockershim 的情况,我是否需要尽早将 RKE 升级到 Kubernetes 1.21?
A. 在使用 Kubernetes 1.20 的 RKE 中,Dockershim 版本依然可用,而且在 Kubernetes 1.24 之前不会在上游弃用。Kubernetes 会发出弃用 Dockershim 的警告,而 Rancher 在使用 Kubernetes 1.21 的 RKE 中已经缓解了这个问题。你可以按照计划正常升级到 Kubernetes 1.21,但也应该考虑在升级到 Kubernetes 1.22 时启用外部 Dockershim。在升级到 Kubernetes 1.24 之前,你需要启用外部 Dockershim,此时现有的实现都会被删除。
A: 在使用 Kubernetes 1.20 的 RKE 中,Dockershim 版本依然可用,而且在 Kubernetes 1.24 之前不会在上游弃用。Kubernetes 会发出弃用 Dockershim 的警告,而 Rancher 在使用 Kubernetes 1.21 的 RKE 中已经缓解了这个问题。你可以按照计划正常升级到 Kubernetes 1.21,但也应该考虑在升级到 Kubernetes 1.22 时启用外部 Dockershim。在升级到 Kubernetes 1.24 之前,你需要启用外部 Dockershim,此时现有的实现都会被删除。
有关此移除的更多信息以及时间线,请参见 [Kubernetes Dockershim 弃用相关的常见问题](https://kubernetes.io/blog/2020/12/02/dockershim-faq/#when-will-dockershim-be-removed)。
@@ -24,7 +24,7 @@ Rancher 支持 Windows Server 1809 容器。有关如何使用 Windows Worker
## Rancher 是否支持 Istio?
Rancher 支持 [Istio](../pages-for-subheaders/istio.md)。
Rancher 支持 [Istio](../integrations-in-rancher/istio/istio.md)。
## Rancher 2.x 是否支持使用 Hashicorp 的 Vault 来存储密文?
@@ -4,11 +4,11 @@ title: 安装和配置 kubectl
`kubectl` 是一个 CLI 工具,用于运行 Kubernetes 集群相关的命令。Rancher 2.x 中的许多维护和管理任务都需要它。
### 安装
## 安装
请参阅 [kubectl 安装](https://kubernetes.io/docs/tasks/tools/install-kubectl/)将 kubectl 安装到你的操作系统上。
### 配置
## 配置
使用 RKE 创建 Kubernetes 集群时,RKE 会在本地目录中创建一个 `kube_config_cluster.yml`,该文件包含使用 `kubectl` 或 `helm` 等工具连接到新集群的凭证。
@@ -4,20 +4,19 @@ title: 卸载 Rancher
本文介绍了如果你不再需要 Rancher、不想再由 Rancher 管理集群、或想删除 Rancher Server 需要怎么做。
### 如果 Rancher Server 被删除,下游集群中的工作负载会怎样?
## 如果 Rancher Server 被删除,下游集群中的工作负载会怎样?
如果 Rancher 删除了或无法恢复,Rancher 管理的下游 Kubernetes 集群中的所有工作负载将继续正常运行。
### 如果删除了 Rancher Server,该如何访问下游集群?
## 如果删除了 Rancher Server,该如何访问下游集群?
如果删除了 Rancher,访问下游集群的方式取决于集群的类型和集群的创建方式。总而言之:
- **注册集群**:集群不受影响,你可以注册集群前的方法访问该集群。
- **托管的 Kubernetes 集群**:如果你在 Kubernetes 云提供商(例如 EKS、GKE 或 AKS)中创建集群,你可以继续使用提供商的云凭证来管理集群。
- **RKE 集群**:要访问 [RKE 集群](../pages-for-subheaders/launch-kubernetes-with-rancher.md),集群必须启用了[授权集群端点(authorized cluster endpoint,ACE)](../reference-guides/rancher-manager-architecture/communicating-with-downstream-user-clusters.md#4-授权集群端点),而且你必须从 Rancher UI 下载了集群的 kubeconfig 文件。RKE 集群默认启用授权集群端点。通过使用此端点,你可以直接使用 kubectl 访问你的集群,而不用通过 Rancher Server 的[认证代理](../reference-guides/rancher-manager-architecture/communicating-with-downstream-user-clusters.md#1-认证代理)进行通信。有关配置 kubectl 以使用授权集群端点的说明,请参阅[使用 kubectl 和 kubeconfig 文件直接访问集群](../how-to-guides/new-user-guides/manage-clusters/access-clusters/use-kubectl-and-kubeconfig.md#直接使用下游集群进行身份验证)。这些集群将使用删除 Rancher 时配置的身份验证快照。
- **RKE 集群**:要访问 [RKE 集群](../how-to-guides/new-user-guides/launch-kubernetes-with-rancher/launch-kubernetes-with-rancher.md),集群必须启用了[授权集群端点(authorized cluster endpoint,ACE)](../reference-guides/rancher-manager-architecture/communicating-with-downstream-user-clusters.md#4-授权集群端点),而且你必须从 Rancher UI 下载了集群的 kubeconfig 文件。RKE 集群默认启用授权集群端点。通过使用此端点,你可以直接使用 kubectl 访问你的集群,而不用通过 Rancher Server 的[认证代理](../reference-guides/rancher-manager-architecture/communicating-with-downstream-user-clusters.md#1-认证代理)进行通信。有关配置 kubectl 以使用授权集群端点的说明,请参阅[使用 kubectl 和 kubeconfig 文件直接访问集群](../how-to-guides/new-user-guides/manage-clusters/access-clusters/use-kubectl-and-kubeconfig.md#直接使用下游集群进行身份验证)。这些集群将使用删除 Rancher 时配置的身份验证快照。
### 如果我不想再使用 Rancher 了该怎么做?
## 如果我不想再使用 Rancher 了该怎么做?
:::note
@@ -25,7 +24,7 @@ title: 卸载 Rancher
:::
如果你[在 Kubernetes 集群上安装了 Rancher](../pages-for-subheaders/install-upgrade-on-a-kubernetes-cluster.md),你可以使用 [Rancher Cleanup](https://github.com/rancher/rancher-cleanup) 工具删除 Rancher。
如果你[在 Kubernetes 集群上安装了 Rancher](../getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster/install-upgrade-on-a-kubernetes-cluster.md),你可以使用 [Rancher Cleanup](https://github.com/rancher/rancher-cleanup) 工具删除 Rancher。
在高可用 (HA) 模式下卸载 Rancher 还将删除所有 `helm-operation-*` Pod 和以下应用程序:
@@ -40,7 +39,7 @@ title: 卸载 Rancher
移除 Rancher 不会影响导入的集群。有关其他集群类型,请参考[移除 Rancher 后访问下游集群](#如果删除了-rancher-server该如何访问下游集群)。
### 如果我不想 Rancher 管理我的注册集群该怎么办?
## 如果我不想 Rancher 管理我的注册集群该怎么办?
如果你在 Rancher UI 中删除了已注册的集群,则该集群将与 Rancher 分离,集群不会发生改变,你可以使用注册集群之前的方法访问该集群。
@@ -52,7 +51,7 @@ title: 卸载 Rancher
**结果**:注册的集群已与 Rancher 分离,并在 Rancher 外正常运行。
### 如果我不想 Rancher 管理我的 RKE 集群或托管的 Kubernetes 集群该怎么办?
## 如果我不想 Rancher 管理我的 RKE 集群或托管的 Kubernetes 集群该怎么办?
目前,我们没有将这些集群从 Rancher 中分离出来的功能。在这种情况下,“分离”指的是将 Rancher 组件移除出集群,并独立于 Rancher 管理对集群的访问。
@@ -5,10 +5,10 @@ title: 安全
**是否有强化指南?**
强化指南现在位于[安全](../pages-for-subheaders/rancher-security.md)部分。
强化指南现在位于[安全](../reference-guides/rancher-security/rancher-security.md)部分。
<br/>
**Rancher Kubernetes 集群 CIS Benchmark 测试的结果是什么?**
我们已经针对强化的 Rancher Kubernetes 集群运行了 CIS Kubernetes Benchmark 测试。你可以在[安全](../pages-for-subheaders/rancher-security.md)中找到该评估的结果。
我们已经针对强化的 Rancher Kubernetes 集群运行了 CIS Kubernetes Benchmark 测试。你可以在[安全](../reference-guides/rancher-security/rancher-security.md)中找到该评估的结果。
@@ -2,9 +2,10 @@
title: 技术
---
### 如何重置管理员密码?
## 如何重置管理员密码?
Docker 安装:
```
$ docker exec -ti <container_id> reset-password
New password for default administrator (user-xxxxx):
@@ -12,6 +13,7 @@ New password for default administrator (user-xxxxx):
```
Kubernetes 安装(Helm):
```
$ KUBECONFIG=./kube_config_cluster.yml
$ kubectl --kubeconfig $KUBECONFIG -n cattle-system exec $(kubectl --kubeconfig $KUBECONFIG -n cattle-system get pods -l app=rancher --no-headers | head -1 | awk '{ print $1 }') -c rancher -- reset-password
@@ -19,10 +21,10 @@ New password for default administrator (user-xxxxx):
<new_password>
```
## 我删除/停用了最后一个 admin,该如何解决?
### 我删除/停用了最后一个 admin,该如何解决?
Docker 安装:
```
$ docker exec -ti <container_id> ensure-default-admin
New default administrator (user-xxxxx)
@@ -31,38 +33,40 @@ New password for default administrator (user-xxxxx):
```
Kubernetes 安装(Helm):
```
$ KUBECONFIG=./kube_config_cluster.yml
$ kubectl --kubeconfig $KUBECONFIG -n cattle-system exec $(kubectl --kubeconfig $KUBECONFIG -n cattle-system get pods -l app=rancher | grep '1/1' | head -1 | awk '{ print $1 }') -- ensure-default-admin
New password for default administrator (user-xxxxx):
<new_password>
```
### 如何启用调试日志记录?
## 如何启用调试日志记录?
请参阅[故障排除:日志记录](../troubleshooting/other-troubleshooting-tips/logging.md)。
### 我的 ClusterIP 不响应 ping,该如何解决?
## 我的 ClusterIP 不响应 ping,该如何解决?
ClusterIP 是一个虚拟 IP,不会响应 ping。要测试 ClusterIP 是否配置正确,最好的方法是使用 `curl` 访问 IP 和端口并检查它是否响应。
### 在哪里管理节点模板?
## 在哪里管理节点模板?
打开你的账号菜单(右上角)并选择`节点模板`。
### 为什么我的四层负载均衡器处于 `Pending` 状态?
## 为什么我的四层负载均衡器处于 `Pending` 状态?
四层负载均衡器创建为 `type: LoadBalancer`。Kubernetes 需要一个可以满足这些请求的云提供商或控制器,否则这些请求将永远处于 `Pending` 状态。有关更多信息,请参阅[云提供商](../pages-for-subheaders/set-up-cloud-providers.md)或[创建外部负载均衡器](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/)。
四层负载均衡器创建为 `type: LoadBalancer`。Kubernetes 需要一个可以满足这些请求的云提供商或控制器,否则这些请求将永远处于 `Pending` 状态。有关更多信息,请参阅[云提供商](../how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/set-up-cloud-providers/set-up-cloud-providers.md)或[创建外部负载均衡器](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/)。
### Rancher 的状态存储在哪里?
## Rancher 的状态存储在哪里?
- Docker 安装:在 `rancher/rancher` 容器的嵌入式 etcd 中,位于 `/var/lib/rancher`。
- Kubernetes install:在为运行 Rancher 而创建的 RKE 集群的 etcd 中。
### 支持的 Docker 版本是如何确定的?
## 支持的 Docker 版本是如何确定的?
我们遵循上游 Kubernetes 版本验证过的 Docker 版本。如果需要获取验证过的版本,请查看 Kubernetes 版本 CHANGELOG.md 中的 [External Dependencies](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.10.md#external-dependencies)。
### 如何访问 Rancher 创建的节点?
## 如何访问 Rancher 创建的节点?
你可以转到**节点**视图,然后下载用于访问 Rancher 创建的节点的 SSH 密钥。选择要访问的节点并单击行尾 **⋮** 按钮,然后选择**下载密钥**,如下图所示。
@@ -74,14 +78,14 @@ ClusterIP 是一个虚拟 IP,不会响应 ping。要测试 ClusterIP 是否配
$ ssh -i id_rsa user@ip_of_node
```
### 如何在 Rancher 中自动化任务 X?
## 如何在 Rancher 中自动化任务 X?
UI 由静态文件组成,并根据 API 的响应工作。换言之,UI 中可以执行的每个操作/任务都可以通过 API 进行自动化。有两种方法可以实现这一点:
* 访问 `https://your_rancher_ip/v3` 并浏览 API 选项。
* 在使用 UI 时捕获 API 调用(通常使用 [Chrome 开发者工具](https://developers.google.com/web/tools/chrome-devtools/#network),但你也可以使用其他工具)。
### 节点的 IP 地址改变了,该如何恢复?
## 节点的 IP 地址改变了,该如何恢复?
节点需要配置静态 IP(或使用 DHCP 保留的 IP)。如果节点的 IP 已更改,你必须在集群中删除并重新添加它。删除后,Rancher 会将集群更新为正确的状态。如果集群不再处于 `Provisioning` 状态,则已从集群删除该节点。
@@ -89,11 +93,11 @@ UI 由静态文件组成,并根据 API 的响应工作。换言之,UI 中可
在集群中移除并清理节点时,你可以将节点重新添加到集群中。
### 如何将其他参数/绑定/环境变量添加到 Rancher 启动的 Kubernetes 集群的 Kubernetes 组件中?
## 如何将其他参数/绑定/环境变量添加到 Rancher 启动的 Kubernetes 集群的 Kubernetes 组件中?
你可以使用集群选项中的[配置文件](../reference-guides/cluster-configuration/rancher-server-configuration/rke1-cluster-configuration.md#rke-集群配置文件参考)选项来添加其他参数/​​绑定/环境变量。有关详细信息,请参阅 RKE 文档中的[其他参数、绑定和环境变量](https://rancher.com/docs/rke/latest/en/config-options/services/services-extras/),或浏览 [Cluster.ymls 示例](https://rancher.com/docs/rke/latest/en/example-yamls/)。
### 如何检查证书链是否有效?
## 如何检查证书链是否有效?
使用 `openssl verify` 命令来验证你的证书链:
@@ -134,7 +138,7 @@ subject= /C=GB/ST=England/O=Alice Ltd/CN=rancher.yourdomain.com
issuer= /C=GB/ST=England/O=Alice Ltd/CN=Alice Intermediate CA
```
### 如何在服务器证书中检查 `Common Name` 和 `Subject Alternative Names`?
## 如何在服务器证书中检查 `Common Name` 和 `Subject Alternative Names`?
虽然技术上仅需要 `Subject Alternative Names` 中有一个条目,但在 `Common Name` 和 `Subject Alternative Names` 中都包含主机名可以最大程度地提高与旧版浏览器/应用程序的兼容性。
@@ -152,7 +156,7 @@ openssl x509 -noout -in cert.pem -text | grep DNS
DNS:rancher.my.org
```
### 为什么节点发生故障时重新调度一个 pod 需要 5 分钟以上的时间?
## 为什么节点发生故障时重新调度一个 pod 需要 5 分钟以上的时间?
这是以下默认 Kubernetes 设置的组合导致的:
@@ -171,6 +175,6 @@ Kubernetes 1.13 默认启用 `TaintBasedEvictions` 功能。有关详细信息
* `default-not-ready-toleration-seconds`:表示 `notReady:NoExecute` 的容忍度的 `tolerationSeconds`,该设置默认添加到还没有该容忍度的 pod。
* `default-unreachable-toleration-seconds`:表示 `unreachable:NoExecute` 的容忍度的 `tolerationSeconds`,该设置默认添加到还没有该容忍度的 pod。
### 我可以在 UI 中使用键盘快捷键吗?
## 我可以在 UI 中使用键盘快捷键吗?
是的,你可以使用键盘快捷键访问 UI 的大部分内容。要查看快捷方式的概览,请在 UI 任意位置按 `?`。
@@ -2,11 +2,11 @@
title: 遥测
---
### 什么是遥测?
## 什么是遥测?
遥测(Telemetry)收集 Rancher 安装大小、使用的组件版本以及使用功能的汇总信息。Rancher Labs 会使用此信息来改进产品,我们不会与第三方共享此信息。
### 收集什么信息?
## 收集什么信息?
我们不会收集任何识别信息(如用户名、密码或用户资源的名称或地址)。
@@ -20,12 +20,12 @@ title: 遥测
- 运行的 Rancher 的镜像名称和版本。
- 此安装的唯一随机标识符。
### 我可以看到发送的信息吗?
## 我可以看到发送的信息吗?
如果启用了遥测,你可以转到 `https://<your rancher server>/v1-telemetry` 查看当前数据。
如果未启用遥测,则收集数据的进程未运行,因此没有可供查看的内容。
### 如何打开或关闭它?
## 如何打开或关闭它?
完成初始设置后,管理员可以转到 UI `全局`中的`设置`页面,单击**编辑**,然后将 `telemetry-opt` 更改为 `in` 或 `out`。
@@ -8,7 +8,7 @@ title: 在离线环境中升级
:::
### Rancher Helm 模板选项
## Rancher Helm 模板选项
使用安装 Rancher 时选择的选项来渲染 Rancher 模板。参考下表来替换每个占位符。Rancher 需要配置为使用私有镜像仓库,以便配置所有 Rancher 启动的 Kubernetes 集群或 Rancher 工具。
@@ -21,7 +21,6 @@ title: 在离线环境中升级
| `<REGISTRY.YOURDOMAIN.COM:PORT>` | 你的私有镜像仓库的 DNS 名称。 |
| `<CERTMANAGER_VERSION>` | 在 K8s 集群上运行的 cert-manager 版本。 |
### 选项 A:使用默认的自签名证书
```
@@ -180,7 +180,7 @@ ingress-nginx-controller LoadBalancer 10.3.244.156 35.233.206.34 80:3187
## 10. 安装 Rancher Helm Chart
按照[本页](../../../pages-for-subheaders/install-upgrade-on-a-kubernetes-cluster.md#安装-rancher-helm-chart)的说明安装 Rancher Helm Chart。任何 Kubernetes 发行版上安装的 Rancher 的 Helm 说明都是一样的。
按照[本页](./install-upgrade-on-a-kubernetes-cluster.md#安装-rancher-helm-chart)的说明安装 Rancher Helm Chart。任何 Kubernetes 发行版上安装的 Rancher 的 Helm 说明都是一样的。
安装 Rancher 时,使用上一步获取的 DNS 名称作为 Rancher Server 的 URL。它可以作为 Helm 选项传递进来。例如,如果 DNS 名称是 `rancher.my.org`,你需要使用 `--set hostname=rancher.my.org` 选项来运行 Helm 安装命令。
@@ -190,7 +190,7 @@ ingress-nginx-controller LoadBalancer 10.3.244.156 35.233.206.34 80:3187
--set ingress.ingressClassName=nginx
```
请参阅[Helm 安装命令](install-upgrade-on-a-kubernetes-cluster.md#5-根据你选择的证书选项通过-helm-安装-rancher)了解你的证书选项。
请参阅[Helm 安装命令](./install-upgrade-on-a-kubernetes-cluster.md#5-根据你选择的证书选项通过-helm-安装-rancher)了解你的证书选项。
在 Rancher v2.7.5 中,如果你打算在集群上使用默认的 GKE Ingress 而不启用 VPC 原生的集群模式,则需要设置以下标志:
@@ -4,7 +4,7 @@ title: Rancher Server Kubernetes 集群的问题排查
本文介绍如何对安装在 Kubernetes 集群上的 Rancher 进行故障排除。
### 相关命名空间
## 相关命名空间
故障排除主要针对以下 3 个命名空间中的对象:
@@ -12,7 +12,7 @@ title: Rancher Server Kubernetes 集群的问题排查
- `ingress-nginx`:Ingress Controller Pod 和 services。
- `cert-manager`:`cert-manager` Pod。
### "default backend - 404"
## "default backend - 404"
很多操作都有可能导致 Ingress Controller 无法将流量转发到你的 Rancher 实例。但是大多数情况下都是由错误的 SSL 配置导致的。
@@ -21,7 +21,7 @@ title: Rancher Server Kubernetes 集群的问题排查
- [Rancher 是否正在运行](#检查-rancher-是否正在运行)
- [证书的 Common Name(CN)是 "Kubernetes Ingress Controller Fake Certificate"](#证书的-cn-是-kubernetes-ingress-controller-fake-certificate)
### 检查 Rancher 是否正在运行
## 检查 Rancher 是否正在运行
使用 `kubectl` 检查 `cattle-system` 系统命名空间,并查看 Rancher Pod 的状态是否是 **Running**:
@@ -49,7 +49,7 @@ Events:
Normal Started 11m kubelet, localhost Started container
```
### 检查 Rancher 日志
## 检查 Rancher 日志
使用 `kubectl` 列出 Pod:
@@ -66,7 +66,7 @@ pod/rancher-784d94f59b-vgqzh 1/1 Running 0 10m
kubectl -n cattle-system logs -f rancher-784d94f59b-vgqzh
```
### 证书的 CN 是 "Kubernetes Ingress Controller Fake Certificate"
## 证书的 CN 是 "Kubernetes Ingress Controller Fake Certificate"
使用浏览器检查证书的详细信息。如果显示 CN 是 "Kubernetes Ingress Controller Fake Certificate",则说明读取或颁发 SSL 证书时出现了问题。
@@ -76,7 +76,7 @@ kubectl -n cattle-system logs -f rancher-784d94f59b-vgqzh
:::
### 排查 Cert-Manager 颁发的证书(Rancher 或 Let's Encrypt 生成的)问题
## 排查 Cert-Manager 颁发的证书(Rancher 或 Let's Encrypt 生成的)问题
`cert-manager` 有 3 部分:
@@ -107,7 +107,7 @@ Events:
Warning ErrGetKeyPair 9m (x16 over 19m) cert-manager Error getting keypair for CA issuer: secret "tls-rancher" not found
```
### 排查你自己提供的 SSL 证书问题
## 排查你自己提供的 SSL 证书问题
你的证书直接应用于 `cattle-system` 命名空间中的 Ingress 对象。
@@ -127,7 +127,7 @@ kubectl -n ingress-nginx logs -f nginx-ingress-controller-rfjrq nginx-ingress-co
W0705 23:04:58.240571 7 backend_ssl.go:49] error obtaining PEM from secret cattle-system/tls-rancher-ingress: error retrieving secret cattle-system/tls-rancher-ingress: secret cattle-system/tls-rancher-ingress was not found
```
### 没有匹配的 "Issuer"
## 没有匹配的 "Issuer"
你所选的 SSL 配置要求在安装 Rancher 之前先安装 Cert-Manager,否则会出现以下错误:
@@ -138,18 +138,18 @@ Error: validation failed: unable to recognize "": no matches for kind "Issuer" i
在这种情况下,先安装 Cert-Manager,然后再重新安装 Rancher。
### Canal Pod 显示 READY 2/3
## Canal Pod 显示 READY 2/3
此问题的最常见原因是端口 8472/UDP 在节点之间未打开。因此,你可以检查你的本地防火墙、网络路由或安全组。
解决网络问题后,`canal` Pod 会超时并重启以建立连接。
### nginx-ingress-controller Pod 显示 RESTARTS
## nginx-ingress-controller Pod 显示 RESTARTS
此问题的最常见原因是 `canal` pod 未能建立覆盖网络。参见 [canal Pod 显示 READY `2/3`](#canal-pod-显示-ready-23) 进行排查。
### Failed to dial to /var/run/docker.sock: ssh: rejected: administratively prohibited (open failed)
## Failed to dial to /var/run/docker.sock: ssh: rejected: administratively prohibited (open failed)
此错误的原因可能是:
@@ -171,18 +171,18 @@ $ nc xxx.xxx.xxx.xxx 22
SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.10
```
### Failed to dial ssh using address [xxx.xxx.xxx.xxx:xx]: Error configuring SSH: ssh: no key found
## Failed to dial ssh using address [xxx.xxx.xxx.xxx:xx]: Error configuring SSH: ssh: no key found
`ssh_key_path` 密钥文件无法访问:请确保你已经指定了私钥文件(不是公钥 `.pub`),而且运行 `rke` 命令的用户可以访问该私钥文件。
### Failed to dial ssh using address [xxx.xxx.xxx.xxx:xx]: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
## Failed to dial ssh using address [xxx.xxx.xxx.xxx:xx]: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
`ssh_key_path` 密钥文件不是访问节点的正确文件:请仔细检查,确保你已为节点指定了正确的 `ssh_key_path` 和连接用户。
### Failed to dial ssh using address [xxx.xxx.xxx.xxx:xx]: Error configuring SSH: ssh: cannot decode encrypted private keys
## Failed to dial ssh using address [xxx.xxx.xxx.xxx:xx]: Error configuring SSH: ssh: cannot decode encrypted private keys
如需使用加密的私钥,请使用 `ssh-agent` 来使用密码来加载密钥。如果在运行 `rke` 命令的环境中找到 `SSH_AUTH_SOCK` 环境变量,它将自动用于连接到节点。
### Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
## Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
节点无法通过配置的 `address` 和 `port` 访问。
@@ -22,7 +22,7 @@ title: 功能开关
- `multi-cluster-management`:允许配置和管理多个 Kubernetes 集群。此标志只能在安装时设置。后续无法启用或禁用它。
- `rke1-custom-node-cleanup`:清除已删除的 RKE1 自定义节点。建议你启用此标志,以防止已删除的节点尝试重新加入集群。
- `rke2`:启用配置 RKE2 集群。此标志默认启用。
- `token-hashing`:启用令牌哈希。启用后,会使用 SHA256 算法对现有 Token 和所有新 Token 进行哈希处理。一旦对 Token 进行哈希处理,就无法撤消操作。此标志在启用后无法禁用。有关详细信息,请参阅 [API 令牌](../../../reference-guides/about-the-api/api-tokens.md#令牌哈希)。
- `token-hashing`:启用令牌哈希。启用后,会使用 SHA256 算法对现有 Token 和所有新 Token 进行哈希处理。一旦对 Token 进行哈希处理,就无法撤消操作。此标志在启用后无法禁用。有关详细信息,请参阅 [API 令牌](../../../api/api-tokens.md#令牌哈希)。
- `unsupported-storage-drivers`:允许启用非默认启用的存储提供程序和卷插件。有关详细信息,请参阅[允许使用不受支持的存储驱动程序](../../../how-to-guides/advanced-user-guides/enable-experimental-features/unsupported-storage-drivers.md)。
下表介绍了 Rancher 中功能开关的可用性和默认值。标记为“GA”的功能已普遍可用:
@@ -18,7 +18,7 @@ enable_cri_dockerd: true
如果你想使用其他容器运行时,Rancher 也提供使用 Containerd 作为默认运行时的,以边缘为中心的 K3s,和以数据中心为中心的 RKE2 Kubernetes 发行版。然后,你就可以通过 Rancher 对导入的 RKE2 和 K3s Kubernetes 集群进行升级和管理。
### 常见问题
## 常见问题
<br/>
@@ -24,7 +24,7 @@ Docker 安装适用于想要测试 Rancher 的用户。
选择以下的选项之一:
### 选项 A:使用 Rancher 默认的自签名证书
## 选项 A:使用 Rancher 默认的自签名证书
<details id="option-a">
<summary>单击展开</summary>
@@ -51,7 +51,7 @@ docker run -d --restart=unless-stopped \
</details>
### 选项 B:使用你自己的证书 - 自签名
## 选项 B:使用你自己的证书 - 自签名
<details id="option-b">
<summary>单击展开</summary>
@@ -94,7 +94,7 @@ docker run -d --restart=unless-stopped \
</details>
### 选项 C:使用你自己的证书 - 可信 CA 签名的证书
## 选项 C:使用你自己的证书 - 可信 CA 签名的证书
<details id="option-c">
<summary>单击展开</summary>
@@ -21,7 +21,7 @@ Rancher 可以安装在任何 Kubernetes 集群上。为了阅读方便,我们
- **1 个 DNS 记录**:用于将 URL 映射到负载均衡器。此 DNS 记录将成为 Rancher Server 的 URL,下游集群需要可以访问到这个地址。
- **私有镜像仓库**,用于将容器镜像分发到你的主机。
### 1. 配置 Linux 节点
## 1. 配置 Linux 节点
这些主机会断开互联网链接,但需要能与你的私有镜像仓库连接。
@@ -29,7 +29,7 @@ Rancher 可以安装在任何 Kubernetes 集群上。为了阅读方便,我们
如需获取配置 Linux 节点的示例,请参见[在 Amazon EC2 中配置节点](../../../../how-to-guides/new-user-guides/infrastructure-setup/nodes-in-amazon-ec2.md)的教程。
### 2. 配置外部数据库
## 2. 配置外部数据库
K3s 与其他 Kubernetes 发行版不同,在于其支持使用 etcd 以外的数据库来运行 Kubernetes。该功能让 Kubernetes 运维更加灵活。你可以根据实际情况选择合适的数据库。
@@ -45,7 +45,7 @@ K3s 与其他 Kubernetes 发行版不同,在于其支持使用 etcd 以外的
如需获取配置 K3s 集群数据库的所有可用选项,请参见 [K3s 官方文档](https://rancher.com/docs/k3s/latest/en/installation/datastore/)。
### 3. 配置负载均衡器
## 3. 配置负载均衡器
你还需要设置一个负载均衡器,来将流量重定向到两个节点上的 Rancher 副本。配置后,当单个节点不可用时,继续保障与 Rancher Management Server 的通信。
@@ -68,7 +68,7 @@ K3s 与其他 Kubernetes 发行版不同,在于其支持使用 etcd 以外的
:::
### 4. 配置 DNS 记录
## 4. 配置 DNS 记录
配置完负载均衡器后,你将需要创建 DNS 记录,以将流量发送到该负载均衡器。
@@ -78,7 +78,7 @@ K3s 与其他 Kubernetes 发行版不同,在于其支持使用 etcd 以外的
有关设置 DNS 记录以将域流量转发到 Amazon ELB 负载均衡器的指南,请参见 [AWS 官方文档](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-elb-load-balancer)。
### 5. 配置私有镜像仓库
## 5. 配置私有镜像仓库
Rancher 支持使用私有镜像仓库进行离线安装。你必须有自己的私有镜像仓库或使用其他方式将容器镜像分发到主机。
@@ -102,21 +102,21 @@ Rancher 支持使用私有镜像仓库进行离线安装。你必须有自己的
这些节点必须位于同一个区域或数据中心。但是你可以把这些服务器放在不同的可用区。
### 为什么使用三个节点?
## 为什么使用三个节点?
在 RKE 集群中,Rancher Server 的数据存储在 etcd 中。而这个 etcd 数据库在这三个节点上运行。
为了选举出大多数 etcd 节点认可的 etcd 集群 leader,etcd 数据库需要奇数个节点。如果 etcd 数据库无法选出 leader,etcd 可能会出现[脑裂(split brain)](https://www.quora.com/What-is-split-brain-in-distributed-systems)的问题,此时你需要使用备份恢复集群。如果三个 etcd 节点之一发生故障,其余两个节点可以选择一个 leader,因为它们是 etcd 节点总数的大多数部分。
### 1. 配置 Linux 节点
## 1. 配置 Linux 节点
这些主机会断开互联网链接,但需要能与你的私有镜像仓库连接。
请确保你的节点满足[操作系统,容器运行时,硬件和网络](../../../../pages-for-subheaders/installation-requirements.md)的常规要求。
请确保你的节点满足[操作系统,容器运行时,硬件和网络](../../installation-requirements/installation-requirements.md)的常规要求。
如需获取配置 Linux 节点的示例,请参见[在 Amazon EC2 中配置节点](../../../../how-to-guides/new-user-guides/infrastructure-setup/nodes-in-amazon-ec2.md)的教程。
### 2. 配置负载均衡器
## 2. 配置负载均衡器
你还需要设置一个负载均衡器,来将流量重定向到两个节点上的 Rancher 副本。配置后,当单个节点不可用时,继续保障与 Rancher Management Server 的通信。
@@ -139,7 +139,7 @@ Rancher 支持使用私有镜像仓库进行离线安装。你必须有自己的
:::
### 3. 配置 DNS 记录
## 3. 配置 DNS 记录
配置完负载均衡器后,你将需要创建 DNS 记录,以将流量发送到该负载均衡器。
@@ -149,7 +149,7 @@ Rancher 支持使用私有镜像仓库进行离线安装。你必须有自己的
有关设置 DNS 记录以将域流量转发到 Amazon ELB 负载均衡器的指南,请参见 [AWS 官方文档](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-elb-load-balancer)。
### 4. 配置私有镜像仓库
## 4. 配置私有镜像仓库
Rancher 支持使用安全的私有镜像仓库进行离线安装。你必须有自己的私有镜像仓库或使用其他方式将容器镜像分发到主机。
@@ -172,15 +172,15 @@ Rancher 支持使用安全的私有镜像仓库进行离线安装。你必须有
:::
### 1. 配置 Linux 节点
## 1. 配置 Linux 节点
此主机会断开互联网链接,但需要能与你的私有镜像仓库连接。
请确保你的节点满足[操作系统,容器,硬件和网络](../../../../pages-for-subheaders/installation-requirements.md)的常规安装要求。
请确保你的节点满足[操作系统,容器,硬件和网络](../../installation-requirements/installation-requirements.md)的常规安装要求。
如需获取配置 Linux 节点的示例,请参见[在 Amazon EC2 中配置节点](../../../../how-to-guides/new-user-guides/infrastructure-setup/nodes-in-amazon-ec2.md)的教程。
### 2. 配置私有 Docker 镜像仓库
## 2. 配置私有 Docker 镜像仓库
Rancher 支持使用私有镜像仓库在堡垒服务器中进行离线安装。你必须有自己的私有镜像仓库或使用其他方式将容器镜像分发到主机。
@@ -189,5 +189,5 @@ Rancher 支持使用私有镜像仓库在堡垒服务器中进行离线安装。
</TabItem>
</Tabs>
### 后续操作
## 后续操作
[收集镜像并发布到你的私有镜像仓库](publish-images.md)
@@ -4,7 +4,7 @@ title: 4. 安装 Rancher
本文介绍如何在高可用 Kubernetes 安装的离线环境部署 Rancher。离线环境可以是 Rancher Server 离线安装、防火墙后面或代理后面。
### Rancher 特权访问
## Rancher 特权访问
当 Rancher Server 部署在 Docker 容器中时,容器内会安装一个本地 Kubernetes 集群供 Rancher 使用。为 Rancher 的很多功能都是以 deployment 的方式运行的,而在容器内运行容器是需要特权模式的,因此你需要在安装 Rancher 时添加 `--privileged` 选项。
@@ -116,7 +116,7 @@ curl -L -o cert-manager-crd.yaml https://github.com/cert-manager/cert-manager/re
将获取的 Chart 复制到有权访问 Rancher Server 集群的系统以完成安装。
##### 1. 安装 Cert-Manager
#### 1. 安装 Cert-Manager
使用要用于安装 Chart 的选项来安装 cert-manager。记住要设置 `image.repository` 选项,以从你的私有镜像仓库拉取镜像。此操作会创建一个包含 Kubernetes manifest 文件的 `cert-manager` 目录。
@@ -156,7 +156,8 @@ curl -L -o cert-manager-crd.yaml https://github.com/cert-manager/cert-manager/re
</details>
##### 2. 安装 Rancher
#### 2. 安装 Rancher
首先,参见[添加 TLS 密文](../../resources/add-tls-secrets.md)发布证书文件,以便 Rancher 和 Ingress Controller 可以使用它们。
然后,使用 kubectl 为 Rancher 创建命名空间:
@@ -2,13 +2,13 @@
title: 其他安装方式
---
### 离线安装
## 离线安装
按照[以下步骤](air-gapped-helm-cli-install/air-gapped-helm-cli-install.md)在离线环境中安装 Rancher Server。
离线环境可以是 Rancher Server 离线安装、防火墙后面或代理后面。
### Docker 安装
## Docker 安装
[单节点 Docker 安装](rancher-on-a-single-node-with-docker/rancher-on-a-single-node-with-docker.md)适用于想要测试 Rancher 的用户。你无需使用 Helm 在 Kubernetes 集群上运行 Rancher,你可以使用 `docker run` 命令,把 Rancher Server 组件安装到单个节点上。
@@ -4,7 +4,7 @@ title: 3. 安装 Rancher
在前文的操作后,你已经有了一个运行的 RKE 集群,现在可以在其中安装 Rancher 了。出于安全考虑,所有到 Rancher 的流量都必须使用 TLS 加密。在本教程中,你将使用 [cert-manager](https://cert-manager.io/)自动颁发自签名证书。在实际使用情况下,你可使用 Let's Encrypt 或自己的证书。
### 安装 Helm CLI
## 安装 Helm CLI
<DeprecationHelm2 />
@@ -16,7 +16,7 @@ chmod +x get_helm.sh
sudo ./get_helm.sh
```
### 安装 cert-manager
## 安装 cert-manager
添加 cert-manager Helm 仓库:
@@ -59,7 +59,7 @@ kubectl rollout status deployment -n cert-manager cert-manager
kubectl rollout status deployment -n cert-manager cert-manager-webhook
```
### 安装 Rancher
## 安装 Rancher
接下来,你可以安装 Rancher 了。首先,添加 Helm 仓库:
@@ -97,7 +97,7 @@ kubectl rollout status deployment -n cattle-system rancher
:::
### 其他资源
## 其他资源
以下资源可能对安装 Rancher 有帮助:
@@ -12,13 +12,13 @@ title: '1. 配置基础设施'
这些节点必须位于同一个区域或数据中心。但是你可以把这些服务器放在不同的可用区。
### 为什么使用三个节点?
## 为什么使用三个节点?
在 RKE 集群中,Rancher Server 的数据存储在 etcd 中。而这个 etcd 数据库在这三个节点上运行。
为了选举出大多数 etcd 节点认可的 etcd 集群 leader,etcd 数据库需要奇数个节点。如果 etcd 数据库无法选出 leader,etcd 可能会出现[脑裂(split brain)](https://www.quora.com/What-is-split-brain-in-distributed-systems)的问题,此时你需要使用备份恢复集群。如果三个 etcd 节点之一发生故障,其余两个节点可以选择一个 leader,因为它们是 etcd 节点总数的大多数部分。
### 1. 配置 Linux 节点
## 1. 配置 Linux 节点
这些主机将通过 HTTP 代理连接到互联网。
@@ -26,7 +26,7 @@ title: '1. 配置基础设施'
如需获取配置 Linux 节点的示例,请参见[在 Amazon EC2 中配置节点](../../../../how-to-guides/new-user-guides/infrastructure-setup/nodes-in-amazon-ec2.md)的教程。
### 2. 配置负载均衡器
## 2. 配置负载均衡器
你还需要设置一个负载均衡器,来将流量重定向到两个节点上的 Rancher 副本。配置后,当单个节点不可用时,继续保障与 Rancher Management Server 的通信。
@@ -49,7 +49,7 @@ title: '1. 配置基础设施'
:::
### 3. 配置 DNS 记录
## 3. 配置 DNS 记录
配置完负载均衡器后,你将需要创建 DNS 记录,以将流量发送到该负载均衡器。
@@ -60,5 +60,5 @@ title: '1. 配置基础设施'
有关设置 DNS 记录以将域流量转发到 Amazon ELB 负载均衡器的指南,请参见 [AWS 官方文档](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-elb-load-balancer)。
### 后续操作
## 后续操作
[配置 Kubernetes 集群](install-kubernetes.md)
@@ -4,7 +4,7 @@ title: 证书故障排除
<DockerSupportWarning />
### 如何确定我的证书格式是否为 PEM?
## 如何确定我的证书格式是否为 PEM?
你可以通过以下特征识别 PEM 格式:
@@ -48,7 +48,7 @@ VWQqljhfacYPgp8KJUJENQ9h5hZ2nSCrI+W00Jcw4QcEdCI8HL5wmg==
-----END PRIVATE KEY-----
```
### 将 PKCS8 证书密钥转换为 PKCS1
## 将 PKCS8 证书密钥转换为 PKCS1
如果你使用的是 PKCS8 证书密钥文件,Rancher 将打印以下日志:
@@ -64,7 +64,7 @@ openssl rsa -in key.pem -out convertedkey.pem
你可使用 `convertedkey.pem` 作为 Rancher 证书密钥文件。
### 添加中间证书的顺序是什么?
## 添加中间证书的顺序是什么?
添加证书的顺序如下:
@@ -77,7 +77,7 @@ openssl rsa -in key.pem -out convertedkey.pem
-----END CERTIFICATE-----
```
### 如何验证我的证书链?
## 如何验证我的证书链?
你可使用 `openssl` 二进制文件来验证证书链。如果命令的输出以 `Verify return code: 0 (ok)` 结尾(参见以下示例),你的证书链是有效的。`ca.pem` 文件必须与你添加到 `rancher/rancher` 容器中的文件一致。
@@ -147,7 +147,7 @@ docker run -d --volumes-from rancher-data \
rancher/rancher:<RANCHER_VERSION_TAG>
```
特权访问是[必须](../../../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
特权访问是[必须](./rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
</details>
@@ -183,7 +183,7 @@ docker run -d --volumes-from rancher-data \
rancher/rancher:<RANCHER_VERSION_TAG>
```
特权访问是[必须](../../../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
特权访问是[必须](./rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
</details>
@@ -218,7 +218,7 @@ docker run -d --volumes-from rancher-data \
--no-cacerts
```
特权访问是[必须](../../../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
特权访问是[必须](./rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
</details>
#### 选项 D:Let's Encrypt 证书
@@ -255,7 +255,7 @@ docker run -d --volumes-from rancher-data \
--acme-domain <YOUR.DNS.NAME>
```
特权访问是[必须](../../../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
特权访问是[必须](./rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
</details>
@@ -288,7 +288,7 @@ docker run -d --volumes-from rancher-data \
<REGISTRY.YOURDOMAIN.COM:PORT>/rancher/rancher:<RANCHER_VERSION_TAG>
```
特权访问是[必须](../../../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
特权访问是[必须](./rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
</details>
#### 选项 B:使用你自己的证书 - 自签名
@@ -324,7 +324,7 @@ docker run -d --restart=unless-stopped \
--privileged \
<REGISTRY.YOURDOMAIN.COM:PORT>/rancher/rancher:<RANCHER_VERSION_TAG>
```
特权访问是[必须](../../../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
特权访问是[必须](./rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
</details>
#### 选项 C:使用你自己的证书 - 可信 CA 签名的证书
@@ -366,7 +366,7 @@ docker run -d --volumes-from rancher-data \
--privileged
<REGISTRY.YOURDOMAIN.COM:PORT>/rancher/rancher:<RANCHER_VERSION_TAG>
```
特权访问是[必须](../../../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
特权访问是[必须](./rancher-on-a-single-node-with-docker.md#rancher-特权访问)的。
</details>
</TabItem>
@@ -6,7 +6,7 @@ Rancher 首次启动时,会为第一个管理员用户随机生成一个密码
如果你在安装过程中没有使用变量来设置引导密码,则会随机生成引导密码。如需了解使用变量设置引导密码的详情,请参见下文。
### 在 Helm 安装中指定引导密码
## 在 Helm 安装中指定引导密码
Helm 安装的情况下,你可以使用 `.Values.bootstrapPassword` 在 Helm Chart 值中指定引导密码变量。
@@ -16,7 +16,7 @@ Helm 安装的情况下,你可以使用 `.Values.bootstrapPassword` 在 Helm C
kubectl get secret --namespace cattle-system bootstrap-secret -o go-template='{{ .data.bootstrapPassword|base64decode}}{{ "\n" }}'
```
### 在 Docker 安装中指定引导密码
## 在 Docker 安装中指定引导密码
如果 Rancher 是使用 Docker 安装的,你可以通过在 Docker 安装命令中传递 `-e CATTLE_BOOTSTRAP_PASSWORD=password` 来指定引导密码。
@@ -95,7 +95,7 @@ Rancher Helm Chart 版本与 Rancher 版本(即 `appVersion`)对应。添加
</TabItem>
<TabItem value="Docker 镜像">
在执行 [Docker 安装](../../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md)、升级或回滚时,你可以使用 _tags_ 来安装特定版本的 Rancher。
在执行 [Docker 安装](../other-installation-methods/rancher-on-a-single-node-with-docker/rancher-on-a-single-node-with-docker.md)、升级或回滚时,你可以使用 _tags_ 来安装特定版本的 Rancher。
### Server 标签
@@ -2,19 +2,19 @@
title: 资源
---
### Docker 安装
## Docker 安装
[单节点 Docker 安装](../other-installation-methods/rancher-on-a-single-node-with-docker/rancher-on-a-single-node-with-docker.md)适用于想要测试 Rancher 的用户。你无需使用 Helm 在 Kubernetes 集群上运行 Rancher,你可以使用 `docker run` 命令,把 Rancher Server 组件安装到单个节点上。
由于只有一个节点和一个 Docker 容器,因此,如果该节点发生故障,由于其他节点上没有可用的 etcd 数据副本,你将丢失 Rancher Server 的所有数据。
### 离线安装
## 离线安装
按照[以下步骤](../other-installation-methods/air-gapped-helm-cli-install/air-gapped-helm-cli-install.md)在离线环境中安装 Rancher Server。
离线环境可以是 Rancher Server 离线安装、防火墙后面或代理后面。
### 高级选项
## 高级选项
安装 Rancher 时,有如下几个可开启的高级选项:每个安装指南中都提供了对应的选项。了解选项详情:
@@ -32,7 +32,7 @@ Rancher 的 Kubernetes 元数据包含 Rancher 用于配置 [RKE 集群](../../h
- 更改 Rancher 用于同步元数据的 URL。适用于要让 Rancher 从本地同步而不是与 GitHub 同步的情况。这在离线环境下非常有用。
- 防止 Rancher 自动同步元数据。这可以防止在 Rancher 中使用新的/不受支持的 Kubernetes 版本。
### 刷新 Kubernetes 元数据
## 刷新 Kubernetes 元数据
默认情况下,管理员或具有**管理集群驱动**[全局角色](../../how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/global-permissions.md)的用户,可以刷新 Kubernetes 元数据。
@@ -44,7 +44,7 @@ Rancher 的 Kubernetes 元数据包含 Rancher 用于配置 [RKE 集群](../../h
你可以将 `refresh-interval-minutes` 设置为 `0`(见下文),将 Rancher 配置为仅在需要时刷新元数据,并在需要时使用此按钮手动执行元数据刷新。
### 配置元数据同步
## 配置元数据同步
:::caution
@@ -70,7 +70,7 @@ RKE 元数据的配置控制 Rancher 同步元数据的频率以及从何处下
但是,如果你有[离线设置](#离线设置)需求,你需要将 Kubernetes 元数据仓库镜像到 Rancher 可用的位置。然后,你需要更改 URL 来指向 JSON 文件的新位置。
### 离线设置
## 离线设置
Rancher Server 会定期刷新 `rke-metadata-config` 来下载新的 Kubernetes 版本元数据。有关 Kubernetes 和 Rancher 版本的兼容性表,请参阅[服务条款](https://rancher.com/support-maintenance-terms/all-supported-versions/rancher-v2.2.8/)。
@@ -2,11 +2,11 @@
title: 部署带有 NodePort 的工作负载
---
### 先决条件
## 先决条件
你已有一个正在运行的集群,且该集群中有至少一个节点。
### 1. 部署工作负载
## 1. 部署工作负载
你可以开始创建你的第一个 Kubernetes [工作负载](https://kubernetes.io/docs/concepts/workloads/)。工作负载是一个对象,其中包含 pod 以及部署应用所需的其他文件和信息。
@@ -36,11 +36,11 @@ title: 部署带有 NodePort 的工作负载
<br/>
### 2. 查看应用
## 2. 查看应用
在**工作负载**页面中,点击工作负载下方的链接。如果 deployment 已完成,你的应用会打开。
### 注意事项
## 注意事项
如果使用云虚拟机,你可能无法访问运行容器的端口。这种情况下,你可以使用 `Execute Shell` 在本地主机的 SSH 会话中测试 Nginx。如果可用的话,使用工作负载下方的链接中 `:` 后面的端口号。在本例中,端口号为 `31568`。
@@ -125,11 +125,11 @@ gettingstarted@rancher:~$
```
### 已完成!
## 已完成!
恭喜!你已成功通过 NodePort 部署工作负载。
#### 后续操作
### 后续操作
使用完沙盒后,你需要清理 Rancher Server 和集群。详情请参见:
@@ -2,11 +2,11 @@
title: 部署带有 Ingress 的工作负载
---
### 先决条件
## 先决条件
你已有一个正在运行的集群,且该集群中有至少一个节点。
### 1. 部署工作负载
## 1. 部署工作负载
你可以开始创建你的第一个 Kubernetes [工作负载](https://kubernetes.io/docs/concepts/workloads/)。工作负载是一个对象,其中包含 pod 以及部署应用所需的其他文件和信息。
@@ -19,7 +19,7 @@ title: 部署带有 Ingress 的工作负载
1. 点击 **Deployment**。
1. 为工作负载设置**名称**。
1. 在**容器镜像**字段中,输入 `rancher/hello-world`。注意区分大小写。
1. 在 `Service Type` 点击 **Add Port** 和 `Cluster IP`,并在 **Private Container Port** 字段中输入`80`。你可以将 `Name` 留空或指定名称。通过添加端口,你可以访问集群内外的应用。有关详细信息,请参阅 [Service](../../../pages-for-subheaders/workloads-and-pods.md#services)。
1. 在 `Service Type` 点击 **Add Port** 和 `Cluster IP`,并在 **Private Container Port** 字段中输入`80`。你可以将 `Name` 留空或指定名称。通过添加端口,你可以访问集群内外的应用。有关详细信息,请参阅 [Service](../../../how-to-guides/new-user-guides/kubernetes-resources-setup/workloads-and-pods/workloads-and-pods.md#services)。
1. 单击**创建**。
**结果**:
@@ -27,7 +27,7 @@ title: 部署带有 Ingress 的工作负载
* 工作负载已部署。此过程可能需要几分钟。
* 当工作负载完成部署后,它的状态会变为 **Active**。你可以从项目的**工作负载**页面查看其状态。
### 2. 通过 Ingress 暴露应用
## 2. 通过 Ingress 暴露应用
现在应用已启动并运行,你需要暴露应用以让其他服务连接到它。
@@ -53,17 +53,17 @@ title: 部署带有 Ingress 的工作负载
**结果**:应用分配到了一个 `sslip.io` 地址并暴露。这可能需要一两分钟。
### 查看应用
## 查看应用
在 **Deployments** 页面中,找到你 deployment 的 **endpoint** 列,然后单击一个 endpoint。可用的 endpoint 取决于你添加到 deployment 中的端口配置。如果你看不到随机分配端口的 endpoint,请将你在创建 Ingress 时指定的路径尾附到 IP 地址上。例如,如果你的 endpoint 是 `xxx.xxx.xxx.xxx` 或 `https://xxx.xxx.xxx.xxx`,把它修改为 `xxx.xxx.xxx.xxx/hello` 或 `https://xxx.xxx.xxx.xxx/hello`。
应用将在另一个窗口中打开。
#### 已完成!
### 已完成!
恭喜!你已成功通过 Ingress 部署工作负载。
#### 后续操作
### 后续操作
使用完沙盒后,你需要清理 Rancher Server 和集群。详情请参见:
@@ -10,14 +10,14 @@ title: 7 层 NGINX 负载均衡器上的 TLS 终止(Docker 安装)
## 操作系统,Docker,硬件和网络要求
请确保你的节点满足常规的[安装要求](../../pages-for-subheaders/installation-requirements.md)。
请确保你的节点满足常规的[安装要求](../../getting-started/installation-and-upgrade/installation-requirements/installation-requirements.md)。
## 安装概要
## 1. 配置 Linux 主机
根据我们的[要求](../../pages-for-subheaders/installation-requirements.md)配置一个 Linux 主机来启动 Rancher Server。
根据我们的[要求](../../getting-started/installation-and-upgrade/installation-requirements/installation-requirements.md)配置一个 Linux 主机来启动 Rancher Server。
## 2. 选择一个 SSL 选项并安装 Rancher
@@ -76,11 +76,11 @@ title: 7 层 NGINX 负载均衡器上的 TLS 终止(Docker 安装)
1. 输入以下命令:
```
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
rancher/rancher:latest --no-cacerts
```
```
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
rancher/rancher:latest --no-cacerts
```
</details>
@@ -166,9 +166,7 @@ http {
## 后续操作
- **推荐**:检查单节点[备份](../../how-to-guides/new-user-guides/backup-restore-and-disaster-recovery/back-up-docker-installed-rancher.md)和[恢复](../../how-to-guides/new-user-guides/backup-restore-and-disaster-recovery/restore-docker-installed-rancher.md)。你可能暂时没有需要备份的数据,但是我们建议你在常规使用 Rancher 后创建备份。
- 创建 Kubernetes 集群:[配置 Kubernetes 集群](../../pages-for-subheaders/kubernetes-clusters-in-rancher-setup.md)。
<br/>
- 创建 Kubernetes 集群:[配置 Kubernetes 集群](../../how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/kubernetes-clusters-in-rancher-setup.md)。
## 常见问题和故障排除
@@ -188,7 +186,7 @@ http {
### 离线环境
如果你访问此页面是为了完成[离线安装](../../pages-for-subheaders/air-gapped-helm-cli-install.md),则在运行安装命令时,先将你的私有镜像仓库 URL 附加到 Server 标志中。也就是说,在 `rancher/rancher:latest` 前面添加 `<REGISTRY.DOMAIN.COM:PORT>` 和私有镜像仓库 URL。
如果你访问此页面是为了完成[离线安装](../../getting-started/installation-and-upgrade/other-installation-methods/air-gapped-helm-cli-install/air-gapped-helm-cli-install.md),则在运行安装命令时,先将你的私有镜像仓库 URL 附加到 Server 标志中。也就是说,在 `rancher/rancher:latest` 前面添加 `<REGISTRY.DOMAIN.COM:PORT>` 和私有镜像仓库 URL。
**示例**:
@@ -208,7 +206,7 @@ docker run -d --restart=unless-stopped \
rancher/rancher:latest
```
此操作需要 [privileged 访问](../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md#rancher-特权访问)。
此操作需要 [privileged 访问](../../getting-started/installation-and-upgrade/other-installation-methods/rancher-on-a-single-node-with-docker/rancher-on-a-single-node-with-docker.md#rancher-特权访问)。
这个 7 层 NGINX 配置已经在 NGINX 1.13(Mainline)和 1.14(Stable)版本上进行了测试。
@@ -59,7 +59,7 @@ kubectl -n cattle-system logs -f rancher-84d886bdbb-s4s69 rancher-audit-log
#### 发送审计日志
你可以为集群启用 Rancher 的内置日志收集和传送功能,将审计日志和其他服务日志发送到支持的 endpoint。详情请参见 [Rancher 工具 - Logging](../../pages-for-subheaders/logging.md)。
你可以为集群启用 Rancher 的内置日志收集和传送功能,将审计日志和其他服务日志发送到支持的 endpoint。详情请参见 [Rancher 工具 - Logging](../../integrations-in-rancher/logging/logging.md)。
## 审计日志示例
@@ -4,7 +4,7 @@ title: 持续交付
Rancher 中预装的 [Fleet](../../../integrations-in-rancher/fleet/fleet.md) 无法完全禁用。但是,你可以使用 `continuous-delivery` 功能开关来禁用 GitOps 持续交付的 Fleet 功能。
如需启用或禁用此功能,请参见[启用实验功能主页](../../../pages-for-subheaders/enable-experimental-features.md)中的说明。
如需启用或禁用此功能,请参见[启用实验功能主页](./enable-experimental-features.md)中的说明。
| 环境变量键 | 默认值 | 描述 |
---|---|---
@@ -4,9 +4,9 @@ title: UI 管理 Istio 虚拟服务和目标规则
此功能可启动一个 UI,用于管理 Istio 的流量,其中包括创建、读取、更新和删除虚拟服务(Virtual Service)和目标规则(Destination Rule)。
> **注意**:启用此功能并不会启用 Istio。集群管理员需要[为集群启用 Istio](../../../pages-for-subheaders/istio-setup-guide.md) 才能使用该功能。
> **注意**:启用此功能并不会启用 Istio。集群管理员需要[为集群启用 Istio](../istio-setup-guide/istio-setup-guide.md) 才能使用该功能。
如需启用或禁用此功能,请参见[启用实验功能主页](../../../pages-for-subheaders/enable-experimental-features.md)中的说明。
如需启用或禁用此功能,请参见[启用实验功能主页](./enable-experimental-features.md)中的说明。
| 环境变量键 | 默认值 | 状态 | 可用于 |
---|---|---|---
@@ -11,7 +11,7 @@ title: "在 ARM64 上运行 Rancher(实验性)"
如果你的节点使用 ARM64 架构,你可以使用以下选项:
- 在 ARM64 架构的节点上运行 Rancher
- 此选项仅适用于 Docker 安装。请知悉,以下安装命令取代了 [Docker 安装链接](../../../pages-for-subheaders/rancher-on-a-single-node-with-docker.md)中的示例:
- 此选项仅适用于 Docker 安装。请知悉,以下安装命令取代了 [Docker 安装链接](../../../getting-started/installation-and-upgrade/other-installation-methods/rancher-on-a-single-node-with-docker/rancher-on-a-single-node-with-docker.md)中的示例:
```
# 在最后一行 `rancher/rancher:vX.Y.Z` 中,请务必将 "X.Y.Z" 替换为包含 ARM64 版本的发布版本。例如,如果你的匹配版本是 v2.5.8,请在此行填写 `rancher/rancher:v2.5.8`。
@@ -4,13 +4,14 @@ title: 使用非默认支持的存储驱动
此功能允许你使用不是默认启用的存储提供商和卷插件。
如需启用或禁用此功能,请参见[启用实验功能主页](../../../pages-for-subheaders/enable-experimental-features.md)中的说明。
如需启用或禁用此功能,请参见[启用实验功能主页](./enable-experimental-features.md)中的说明。
| 环境变量键 | 默认值 | 描述 |
---|---|---
| `unsupported-storage-drivers` | `false` | 启用非默认启用的存储提供商和卷插件。 |
### 默认启用的持久卷插件
## 默认启用的持久卷插件
下表描述了默认启用的存储类型对应的持久卷插件。启用此功能开关时,不在此列表中的任何持久卷插件均被视为实验功能,且不受支持:
| 名称 | 插件 |
@@ -25,7 +26,8 @@ title: 使用非默认支持的存储驱动
| 网络文件系统 | `nfs` |
| hostPath | `host-path` |
### 默认启用的 StorageClass
## 默认启用的 StorageClass
下表描述了默认启用的 StorageClass 对应的持久卷插件。启用此功能开关时,不在此列表中的任何持久卷插件均被视为实验功能,且不受支持:
| 名称 | 插件 |
@@ -19,11 +19,11 @@ title: 1. 在集群中启用 Istio
1. 如果你还没有安装 Monitoring 应用,系统会提示你安装 rancher-monitoring。你也可以选择在 Rancher-monitoring 安装上设置选择器或抓取配置选项。
1. 可选:为 Istio 组件配置成员访问和[资源限制](../../../integrations-in-rancher/istio/cpu-and-memory-allocations.md)。确保你的 Worker 节点上有足够的资源来启用 Istio。
1. 可选:如果需要,对 values.yaml 进行额外的配置更改。
1. 可选:通过[覆盖文件](../../../pages-for-subheaders/configuration-options.md#覆盖文件)来添加其他资源或配置。
1. 可选:通过[覆盖文件](../../../integrations-in-rancher/istio/configuration-options/configuration-options.md#覆盖文件)来添加其他资源或配置。
1. 单击**安装**。
**结果**:已在集群级别安装 Istio。
## 其他配置选项
有关配置 Istio 的更多信息,请参阅[配置参考](../../../pages-for-subheaders/configuration-options.md)。
有关配置 Istio 的更多信息,请参阅[配置参考](../../../integrations-in-rancher/istio/configuration-options/configuration-options.md)。
@@ -19,11 +19,11 @@ title: 2. 在命名空间中启用 Istio
**结果**:命名空间带有了 `istio-injection=enabled` 标签。默认情况下,部署在此命名空间中的所有新工作负载都将注入 Istio sidecar。
### 验证是否启用了自动 Istio Sidecar 注入
## 验证是否启用了自动 Istio Sidecar 注入
要验证 Istio 是否已启用,请在命名空间中部署一个 hello-world 工作负载。转到工作负载并单击 pod 名称。在**容器**中,你应该能看到 `istio-proxy` 容器。
### 排除工作负载的 Istio Sidecar 注入
## 排除工作负载的 Istio Sidecar 注入
要排除 Istio sidecar 被注入某工作负载,请在工作负载上使用以下注释:
@@ -48,6 +48,6 @@ sidecar.istio.io/inject: “false”
:::
## 后续步骤
### 后续步骤
[使用 Istio Sidecar 添加部署](use-istio-sidecar.md)
@@ -72,5 +72,6 @@ spec:
**结果**:生成流到该服务的流量时(例如,刷新 Ingress Gateway URL),你可以在 Kiali 流量图中看到流到 `reviews` 服务的流量被平均分配到了 `v1` 和 `v3`。
### 后续步骤
## 后续步骤
[生成和查看流量](generate-and-view-traffic.md)
@@ -19,7 +19,7 @@ title: 3. 使用 Istio Sidecar 添加部署和服务
等待几分钟,然后工作负载将升级并具有 Istio sidecar。单击它并转到**容器**。你应该能看到该工作负载旁边的 `istio-proxy`。这意味着为工作负载启用了 Istio sidecar。Istio 正在为 Sidecar Envoy 做所有的接线工作。如果你现在在 yaml 中启用它们,Istio 可以自动执行所有功能。
### 添加部署和服务
## 添加部署和服务
以下是在命名空间中添加新 **Deployment** 的几种方法:
@@ -46,7 +46,7 @@ title: 3. 使用 Istio Sidecar 添加部署和服务
1. 如果你的文件存储在本地集群中,运行 `kubectl create -f <name of service/deployment file>.yaml`。
1. 或运行 `cat<< EOF | kubectl apply -f -`,将文件内容粘贴到终端,然后运行 `EOF` 来完成命令。
### 部署和服务示例
## 部署和服务示例
接下来,我们为 Istio 文档中的 BookInfo 应用的示例部署和服务添加 Kubernetes 资源:
@@ -87,7 +87,7 @@ Productpage 服务和部署:
- 一个 `bookinfo-productpage` 的 ServiceAccount。
- 一个 `productpage-v1` Deployment。
### 资源 YAML
## 资源 YAML
```yaml
# Copyright 2017 Istio Authors
@@ -356,5 +356,6 @@ spec:
---
```
### 后续步骤
## 后续步骤
[设置 Istio Gateway](set-up-istio-gateway.md)
@@ -4,18 +4,18 @@ title: Pod 安全策略
:::note
本文介绍的集群选项仅适用于 [Rancher 已在其中启动 Kubernetes 的集群](../../../pages-for-subheaders/launch-kubernetes-with-rancher.md)。
本文介绍的集群选项仅适用于 [Rancher 已在其中启动 Kubernetes 的集群](../../new-user-guides/launch-kubernetes-with-rancher/launch-kubernetes-with-rancher.md)。
:::
你可以在创建项目的时候设置 Pod 安全策略(PSP)。如果在创建项目期间没有为项目分配 PSP,你也随时可以将 PSP 分配给现有项目。
### 先决条件
## 先决条件
- 在 Rancher 中创建 Pod 安全策略。在将默认 PSP 分配给现有项目之前,你必须有一个可分配的 PSP。有关说明,请参阅[创建 Pod 安全策略](../../new-user-guides/authentication-permissions-and-global-configuration/create-pod-security-policies.md)。
- 将默认 Pod 安全策略分配给项目所属的集群。如果 PSP 还没有应用到集群,你无法将 PSP 分配给项目。有关详细信息,请参阅[将 pod 安全策略添加到集群](../../new-user-guides/manage-clusters/add-a-pod-security-policy.md)。
### 应用 Pod 安全策略
## 应用 Pod 安全策略
1. 在左上角,单击 **☰ > 集群管理**。
1. 在**集群**页面上,转到需要移动命名空间的集群,然后单击 **Explore**。
@@ -14,7 +14,7 @@ title: 项目资源配额
Rancher 中的资源配额包含与 [Kubernetes 原生版本](https://kubernetes.io/docs/concepts/policy/resource-quotas/)相同的功能。Rancher 还扩展了资源配额的功能,从而让你将资源配额应用于项目。有关资源配额如何与 Rancher 中的项目一起使用的详细信息,请参阅[此页面](about-project-resource-quotas.md)。
### 将资源配额应用于现有项目
## 将资源配额应用于现有项目
修改资源配额的使用场景如下:
@@ -12,7 +12,7 @@ title: 覆盖命名空间的默认限制
有关详细信息,请参阅[如何编辑命名空间资源配额](../../../new-user-guides/manage-clusters/projects-and-namespaces.md)。
### 编辑命名空间资源配额
## 编辑命名空间资源配额
如果你已为项目配置了资源配额,你可以覆盖命名空间默认限制,从而为特定命名空间提供对更多(或更少)项目资源的访问权限:
@@ -6,7 +6,7 @@ title: 设置容器默认资源限制
为了避免在创建工作负载期间对每个容器设置这些限制,可以在命名空间上指定一个默认的容器资源限制。
### 编辑容器默认资源限制
## 编辑容器默认资源限制
你可以在以下情况下编辑容器的默认资源限制:
@@ -19,7 +19,7 @@ title: 设置容器默认资源限制
1. 找到要编辑容器默认资源限制的项目。在该项目中选择 **⋮ > 编辑配置**。
1. 展开**容器默认资源限制**并编辑对应的值。
### 沿用资源限制
## 沿用资源限制
在项目级别设置默认容器资源限制后,项目中所有新建的命名空间都会沿用这个资源限制参数。新设置的限制不会影响项目中现有的命名空间。你需要为项目中的现有命名空间手动设置默认容器资源限制,以便创建容器时能应用该限制。
@@ -27,7 +27,7 @@ title: 设置容器默认资源限制
在命名空间上配置容器默认资源限制后,在该命名空间中创建的任何容器都会沿用该默认值。你可以在工作负载创建期间覆盖这些限制/预留。
### 容器资源配额类型
## 容器资源配额类型
可以配置以下资源限制:
@@ -26,7 +26,7 @@ _项目_ 是 Rancher 中引入的对象,可帮助你更有组织地管理 Kube
- [配置工具](../../../reference-guides/rancher-project-tools.md)
- [配置 Pod 安全策略](manage-pod-security-policies.md)
### 授权
## 授权
非管理者用户只有在[管理员](../../new-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/global-permissions.md)、[集群所有者或成员](../../new-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/cluster-and-project-roles.md#集群角色)或[项目所有者](../../new-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/cluster-and-project-roles.md#项目角色)将非管理员用户添加到项目的**成员**选项卡后,才能获取项目的访问权限。
@@ -4,13 +4,13 @@ title: 自定义 Grafana 仪表板
在本文中,你将学习通过自定义 Grafana 仪表板来显示特定容器的指标。
### 先决条件
## 先决条件
在自定义 Grafana 仪表板之前,你必须先安装 `rancher-monitoring` 应用。
要查看指向外部监控 UI(包括 Grafana 仪表板)的链接,你至少需要一个 [project-member 角色](../../../integrations-in-rancher/monitoring-and-alerting/rbac-for-monitoring.md#具有-rancher-权限的用户)。
### 登录 Grafana
## 登录 Grafana
1. 在 Rancher UI 中,转到要自定义的仪表板的集群。
1. 在左侧导航栏中,单击**监控**。
@@ -18,8 +18,7 @@ title: 自定义 Grafana 仪表板
1. 转到左下角的登录图标,然后单击 **Sign In**。
1. 登录到 Grafana。Grafana 实例的默认 Admin 用户名和密码是 `admin/prom-operator`(无论谁拥有密码,都需要 Rancher 的集群管理员权限才能访问 Grafana 实例)。你还可以在部署或升级 Chart 时替换凭证。
### 获取支持 Grafana 面板的 PromQL 查询
## 获取支持 Grafana 面板的 PromQL 查询
对于任何面板,你可以单击标题并单击 **Explore** 以获取支持图形的 PromQL 查询。
@@ -12,7 +12,7 @@ Prometheus 经过了优化,可以存储基于索引的序列数据。它是为
但是,Prometheus 没有就快速变化的时间序列数量进行对应的优化。因此,如果你在创建和销毁了大量资源的集群(尤其是多租户集群)上安装 Monitoring,可能会出现内存使用量激增的情况。
### 减少内存激增
## 减少内存激增
为了减少内存消耗,Prometheus 可以通过抓取更少的指标或在时间序列上添加更少的标签,从而存储更少的时间序列。要查看使用内存最多的序列,你可以查看 Prometheus UI 中的 TSDB(时序数据库)状态页面。
@@ -4,7 +4,7 @@ title: 启用 Prometheus Federator
## 要求
默认情况下,Prometheus Federator 已配置并旨在与 [rancher-monitoring](../../../../pages-for-subheaders/monitoring-and-alerting.md) 一起部署。rancher-monitoring 同时部署了 Prometheus Operator 和 Cluster Prometheus,每个项目监控堆栈(Project Monitoring Stack)默认会联合命名空间范围的指标。
默认情况下,Prometheus Federator 已配置并旨在与 [rancher-monitoring](../../../../integrations-in-rancher/monitoring-and-alerting/monitoring-and-alerting.md) 一起部署。rancher-monitoring 同时部署了 Prometheus Operator 和 Cluster Prometheus,每个项目监控堆栈(Project Monitoring Stack)默认会联合命名空间范围的指标。
有关安装 rancher-monitoring 的说明,请参阅[此页面](../enable-monitoring.md)。
@@ -2,11 +2,11 @@
title: 为工作负载设置 Prometheus Federator
---
### 显示工作负载的 CPU 和内存指标
## 显示工作负载的 CPU 和内存指标
使用 Prometheus Federator 显示 CPU 和内存指标的方式与使用 rancher-monitoring 相同。有关说明,请参阅[此处](../set-up-monitoring-for-workloads.md#显示工作负载的-cpu-和内存指标)。
### 设置 CPU 和内存之外的指标
## 设置 CPU 和内存之外的指标
使用 Prometheus Federator 设置 CPU 和内存之外的指标与使用 rancher-monitoring 的方式相同。有关说明,请参阅[此处](../set-up-monitoring-for-workloads.md#设置-cpu-和内存之外的指标)。
@@ -12,13 +12,13 @@ Grafana 显示聚合数据,你也可以使用 PromQL 查询来查看单个工
要为你的工作负载设置自定义指标,你需要设置一个 Exporter 并创建一个新的 ServiceMonitor 自定义资源,从而将 Prometheus 配置为从 Exporter 中抓取指标。
### 显示工作负载的 CPU 和内存指标
## 显示工作负载的 CPU 和内存指标
默认情况下,Monitoring 应用会抓取 CPU 和内存指标。
要获取特定工作负载的细粒度信息,你可以自定义 Grafana 仪表板来显示该工作负载的指标。
### 设置 CPU 和内存之外的指标
## 设置 CPU 和内存之外的指标
对于自定义指标,你需要使用 Prometheus 支持的格式来公开应用上的指标。
@@ -6,14 +6,14 @@ title: 高级配置
<link rel="canonical" href="https://ranchermanager.docs.rancher.com/zh/how-to-guides/advanced-user-guides/monitoring-v2-configuration-guides/advanced-configuration"/>
</head>
### Alertmanager
## Alertmanager
有关配置 Alertmanager 自定义资源的信息,请参阅[此页面。](alertmanager.md)
### Prometheus
## Prometheus
有关配置 Prometheus 自定义资源的信息,请参阅[此页面。](prometheus.md)
### PrometheusRules
## PrometheusRules
有关配置 PrometheusRules 自定义资源的信息,请参阅[此页面。](prometheusrules.md)
@@ -10,7 +10,7 @@ PrometheusRule 定义了一组 Prometheus 告警和/或记录规则。
:::
### 在 Rancher UI 中创建 PrometheusRule
## 在 Rancher UI 中创建 PrometheusRule
:::note 先决条件:
@@ -28,7 +28,7 @@ PrometheusRule 定义了一组 Prometheus 告警和/或记录规则。
**结果**:告警可以向接收器发送通知。
### 关于 PrometheusRule 自定义资源
## 关于 PrometheusRule 自定义资源
当你定义规则时(在 PrometheusRule 资源的 RuleGroup 中声明),[规则本身的规范](https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#rule)会包含标签,然后 Alertmanager 会使用这些标签来确定接收此告警的路由。例如,标签为 `team: front-end` 的告警将​​发送到与该标签匹配的所有路由。
@@ -31,7 +31,7 @@ target prot opt source destination
sudo iptables --list
```
下文介绍如何使用 `firewalld`,将[防火墙端口规则](../../pages-for-subheaders/installation-requirements.md#端口要求)应用到高可用 Rancher Server 集群中的节点。
下文介绍如何使用 `firewalld`,将[防火墙端口规则](../../getting-started/installation-and-upgrade/installation-requirements/installation-requirements.md#端口要求)应用到高可用 Rancher Server 集群中的节点。
## 先决条件
@@ -6,7 +6,7 @@ title: 为大型安装进行 etcd 调优
Kubernetes 每隔五分钟会自动清理 etcd 数据集。在某些情况下(例如发生部署抖动),在垃圾回收发生并进行清理之前会有大量事件写入 etcd 并删除,从而导致 Keyspace 填满。如果你在 etcd 日志或 Kubernetes API Server 日志中看到 `mvcc: database space exceeded` 错误,你可以在 etcd 服务器上设置 [quota-backend-bytes](https://etcd.io/docs/v3.5/op-guide/maintenance/#space-quota) 来增加 Keyspace 的大小。
### 示例:此 RKE cluster.yml 文件的代码片段将 Keyspace 的大小增加到 5GB
## 示例:此 RKE cluster.yml 文件的代码片段将 Keyspace 的大小增加到 5GB
```yaml
# RKE cluster.yml
@@ -12,11 +12,11 @@ title: 添加项目成员
:::
### 将成员添加到新项目
## 将成员添加到新项目
你可以在创建项目时将成员添加到项目中(建议)。有关创建新项目的详细信息,请参阅[集群管理](../../how-to-guides/new-user-guides/manage-clusters/projects-and-namespaces.md)。
### 将成员添加到现有项目
## 将成员添加到现有项目
创建项目后,你可以将用户添加为项目成员,以便用户可以访问项目的资源:
@@ -8,7 +8,7 @@ title: 配置驱动
使用 Rancher 中的驱动,你可以管理可以使用哪些供应商来部署[托管的 Kubernetes 集群](../../kubernetes-clusters-in-rancher-setup/set-up-clusters-from-hosted-kubernetes-providers/set-up-clusters-from-hosted-kubernetes-providers.md)或[云服务器节点](../../launch-kubernetes-with-rancher/use-new-nodes-in-an-infra-provider/use-new-nodes-in-an-infra-provider.md),以允许 Rancher 部署和管理 Kubernetes。
### Rancher 驱动
## Rancher 驱动
你可以启用或禁用 Rancher 中内置的驱动。如果相关驱动 Rancher 尚未实现,你可以添加自己的驱动。
@@ -17,7 +17,7 @@ Rancher 中有两种类型的驱动:
* [集群驱动](#集群驱动)
* [主机驱动](#主机驱动)
### 集群驱动
## 集群驱动
集群驱动用于配置[托管的 Kubernetes 集群](../../kubernetes-clusters-in-rancher-setup/set-up-clusters-from-hosted-kubernetes-providers/set-up-clusters-from-hosted-kubernetes-providers.md),例如 GKE、EKS、AKS 等。创建集群时可以显示的集群驱动,是由集群驱动的状态定义的。只有 `active` 集群驱动将显示为为托管 Kubernetes 集群创建集群的选项。默认情况下,Rancher 与几个现有的集群驱动打包在一起,但你也可以创建自定义集群驱动并添加到 Rancher。
@@ -33,7 +33,7 @@ Rancher 中有两种类型的驱动:
* [Huawei CCE](../../kubernetes-clusters-in-rancher-setup/set-up-clusters-from-hosted-kubernetes-providers/huawei.md)
* [Tencent](../../kubernetes-clusters-in-rancher-setup/set-up-clusters-from-hosted-kubernetes-providers/tencent.md)
### 主机驱动
## 主机驱动
主机驱动用于配置主机,Rancher 使用这些主机启动和管理 Kubernetes 集群。主机驱动与 [Docker Machine 驱动](https://docs.docker.com/machine/drivers/)相同。创建主机模板时可以显示的主机驱动,是由主机驱动的状态定义的。只有 `active` 主机驱动将显示为创建节点模板的选项。默认情况下,Rancher 与许多现有的 Docker Machine 驱动打包在一起,但你也可以创建自定义主机驱动并添加到 Rancher。
@@ -1,12 +1,11 @@
---
title: 集群驱动
---
集群驱动用于在[托管 Kubernetes 提供商](../../../../pages-for-subheaders/set-up-clusters-from-hosted-kubernetes-providers.md)(例如 Google GKE)中创建集群。创建集群时可以显示的集群驱动,是由集群驱动的状态定义的。只有 `active` 集群驱动将作为创建集群的选项显示。默认情况下,Rancher 与多个现有的云提供商集群驱动打包在一起,但你也可以将自定义集群驱动添加到 Rancher。
集群驱动用于在[托管 Kubernetes 提供商](../../kubernetes-clusters-in-rancher-setup/set-up-clusters-from-hosted-kubernetes-providers/set-up-clusters-from-hosted-kubernetes-providers.md)(例如 Google GKE)中创建集群。创建集群时可以显示的集群驱动,是由集群驱动的状态定义的。只有 `active` 集群驱动将作为创建集群的选项显示。默认情况下,Rancher 与多个现有的云提供商集群驱动打包在一起,但你也可以将自定义集群驱动添加到 Rancher。
如果你不想向用户显示特定的集群驱动,你可以在 Rancher 中停用这些集群驱动,它们将不会作为创建集群的选项出现。
### 管理集群驱动
## 管理集群驱动
:::note 先决条件:
@@ -37,6 +36,6 @@ title: 集群驱动
1. 填写**添加集群驱动**表单。然后单击**创建**。
### 开发自己的集群驱动
## 开发自己的集群驱动
如果要开发集群驱动并添加到 Rancher,请参考我们的[示例](https://github.com/rancher-plugins/kontainer-engine-driver-example)。
@@ -6,7 +6,7 @@ title: 主机驱动
如果你不想向用户显示特定的主机驱动,则需要停用这些主机驱动。
#### 管理主机驱动
## 管理主机驱动
:::note 先决条件:
@@ -36,6 +36,6 @@ title: 主机驱动
1. 在**主机驱动**选项卡上,单击**添加主机驱动**。
1. 填写**添加主机驱动**表单。然后单击**创建**。
### 开发自己的主机驱动
## 开发自己的主机驱动
主机驱动使用 [Docker Machine](https://docs.docker.com/machine/) 来实现。
@@ -22,7 +22,7 @@ title: 访问和共享
- 公开 RKE 模板,并与 Rancher 设置中的所有用户共享
- 与受信任修改模板的用户共享模板所有权
### 与特定用户或组共享模板
## 与特定用户或组共享模板
要允许用户或组使用你的模板创建集群,你可以为他们提供模板的基本**用户**访问权限。
@@ -36,7 +36,7 @@ title: 访问和共享
**结果**:用户或组可以使用模板创建集群。
### 与所有用户共享模板
## 与所有用户共享模板
1. 在左上角,单击 **☰ > 集群管理**。
1. 在左侧导航栏,单击 **RKE1 配置 > RKE 模板**。
@@ -46,7 +46,7 @@ title: 访问和共享
**结果**:Rancher 设置中的所有用户都可以使用该模板创建集群。
### 共享模板所有权
## 共享模板所有权
如果你是模板的创建者,你可能希望将维护和更新模板的责任委派给其他用户或组。
@@ -10,10 +10,9 @@ RKE 模板可以应用于新集群。
你无法将集群更改为使用不同的 RKE 模板。你只能将集群更新为同一模板的新版本。
## 使用 RKE 模板创建集群
### 使用 RKE 模板创建集群
要使用 RKE 模板添加[由基础设施提供商托管](../../../../pages-for-subheaders/launch-kubernetes-with-rancher.md)的集群,请按照以下步骤操作:
要使用 RKE 模板添加[由基础设施提供商托管](../../launch-kubernetes-with-rancher/launch-kubernetes-with-rancher.md)的集群,请按照以下步骤操作:
1. 在左上角,单击 **☰ > 集群管理**。
1. 在**集群**页面上,单击**创建**并选择基础设施提供商。
@@ -23,11 +22,11 @@ RKE 模板可以应用于新集群。
1. 可选:你可以编辑 RKE 模板所有者在创建模板时标记为**允许用户覆盖**的任何设置。如果你无法更改某些设置,则需要联系模板所有者以获取模板的新修订版。然后,你需要编辑集群来将其升级到新版本。
1. 单击**创建**以启动集群。
### 更新使用 RKE 模板创建的集群
## 更新使用 RKE 模板创建的集群
模板所有者创建 RKE 模板时,每个设置在 Rancher UI 中都有一个开关,指示用户是否可以覆盖该设置。
- 如果某个设置允许用户覆盖,你可以通过[编辑集群](../../../../pages-for-subheaders/cluster-configuration.md)来更新集群中的设置。
- 如果某个设置允许用户覆盖,你可以通过[编辑集群](../../../../reference-guides/cluster-configuration/cluster-configuration.md)来更新集群中的设置。
- 如果该开关处于关闭状态,则除非集群所有者创建了允许你覆盖这些设置的模板修订版,否则你无法更改这些设置。如果你无法更改某些设置,则需要联系模板所有者以获取模板的新修订版。
如果集群是使用 RKE 模板创建的,你可以编辑集群,来将集群更新为模板的新版本。
@@ -40,7 +39,7 @@ RKE 模板可以应用于新集群。
:::
### 将现有集群转换为使用 RKE 模板
## 将现有集群转换为使用 RKE 模板
本节介绍如何使用现有集群创建 RKE 模板。
@@ -56,4 +55,4 @@ RKE 模板可以应用于新集群。
- 创建了一个新的 RKE 模板。
- 将集群转换为使用该新模板。
- 可以[使用新模板创建新集群](apply-templates.md#使用-rke-模板创建集群)。
- 可以[使用新模板创建新集群](#使用-rke-模板创建集群)。
@@ -8,11 +8,11 @@ title: RKE 模板和基础设施
如果要标准化集群中的硬件,请将 RKE 模板与节点模板或服务器配置工具 (如 Terraform) 结合使用。
### 节点模板
## 节点模板
[节点模板](../../../../reference-guides/user-settings/manage-node-templates.md)负责 Rancher 中的节点配置和节点预配。你可以在用户配置文件中设置节点模板,从而定义在每个节点池中使用的模板。启用节点池后,可以确保每个节点池中都有所需数量的节点,并确保池中的所有节点都相同。
### Terraform
## Terraform
Terraform 是一个服务器配置工具。它使用基础架构即代码,支持使用 Terraform 配置文件创建几乎所有的基础设施。它可以自动执行服务器配置,这种方式是自文档化的,并且在版本控制中易于跟踪。
@@ -27,7 +27,7 @@ Terraform 支持:
- 将基础架构更改纳入标准开发实践
- 防止由于配置偏移,导致一些服务器的配置与其他服务器不同
## Terraform 工作原理
### Terraform 工作原理
Terraform 是用扩展名为 `.tf` 的文件编写的。它是用 HashiCorp 配置语言编写的。HashiCorp 配置语言是一种声明性语言,支持定义集群中所需的基础设施、正在使用的云提供商以及提供商的凭证。然后 Terraform 向提供商发出 API 调用,以便有效地创建基础设施。
@@ -37,7 +37,7 @@ Terraform 是用扩展名为 `.tf` 的文件编写的。它是用 HashiCorp 配
如果你需要对基础设施进行更改,你可以在 Terraform 配置文件中进行更改,而不是手动更新服务器。然后,可以将这些文件提交给版本控制、验证,并根据需要进行检查。然后,当你运行 `terraform apply` 时,更改将会被部署。
## 使用 Terraform 的技巧
### 使用 Terraform 的技巧
- [Rancher 2 提供商文档](https://www.terraform.io/docs/providers/rancher2/)提供了如何配置集群大部分的示例。
@@ -53,7 +53,7 @@ Terraform 是用扩展名为 `.tf` 的文件编写的。它是用 HashiCorp 配
本节描述了一种方法,可以使安全合规相关的配置文件成为集群的标准配置文件。
在你创建[符合 CIS 基准的集群](../../../../pages-for-subheaders/rancher-security.md)时,你有一个加密配置文件和一个审计日志配置文件。
在你创建[符合 CIS 基准的集群](../../../../reference-guides/rancher-security/rancher-security.md)时,你有一个加密配置文件和一个审计日志配置文件。
你的基础设施预配系统可以将这些文件写入磁盘。然后在你的 RKE 模板中,你需要指定这些文件的位置,然后将你的加密配置文件和审计日志配置文件作为额外的挂载添加到 `kube-api-server`。
@@ -65,4 +65,4 @@ Terraform 是用扩展名为 `.tf` 的文件编写的。它是用 HashiCorp 配
- [Terraform 文档](https://www.terraform.io/docs/)
- [Rancher2 Terraform Provider 文档](https://www.terraform.io/docs/providers/rancher2/)
- [The RanchCast - 第 1 集:Rancher 2 Terraform Provider](https://youtu.be/YNCq-prI8-8):在此演示中,社区主管 Jason van Brackel 使用 Rancher 2 Terraform Provider 创建了节点并创建自定义集群。
- [The RanchCast - 第 1 集:Rancher 2 Terraform Provider](https://youtu.be/YNCq-prI8-8):在此演示中,社区主管 Jason van Brackel 使用 Rancher 2 Terraform Provider 创建了节点并创建自定义集群。
@@ -10,14 +10,13 @@ title: 创建和修改 RKE 模板
模板所有者对模板修订版具有完全控制权,并且可以创建新的修订版来更新模板,删除或禁用不应被用于创建集群的修订版,和设置默认的模板修订版。
### 先决条件
## 先决条件
如果你具有**创建 RKE 模板**权限,则可以创建 RKE 模板,该权限可由[管理员授予](creator-permissions.md)。
如果你是模板的所有者,你可以修改、共享和删除模板。有关如何成为模板所有者的详细信息,请参阅[共享模板所有权文档](access-or-share-templates.md#共享模板所有权)。
### 创建模板
## 创建模板
1. 在左上角,单击 **☰ > 集群管理**。
1. 单击 **RKE1 配置 > 节点模板**。
@@ -26,9 +25,9 @@ title: 创建和修改 RKE 模板
1. 可选:通过将用户添加为成员,来[与其他用户或组共享模板](access-or-share-templates.md#与特定用户或组共享模板)。你还可以将模板公开,从而与 Rancher 中的所有人共享。
1. 然后按照屏幕上的表格将集群配置参数保存为模板修订的一部分。可以将修订标记为此模板的默认值。
**结果**:配置了具有一个修订版的 RKE 模板。你可以稍后在[配置 Rancher 启动的集群](../../../../pages-for-subheaders/launch-kubernetes-with-rancher.md)时使用此 RKE 模板修订版。通过 RKE 模板管理集群后,集群无法解除与模板的绑定,并且无法取消选中**使用现有 RKE 模板和修订版**。
**结果**:配置了具有一个修订版的 RKE 模板。你可以稍后在[配置 Rancher 启动的集群](../../launch-kubernetes-with-rancher/launch-kubernetes-with-rancher.md)时使用此 RKE 模板修订版。通过 RKE 模板管理集群后,集群无法解除与模板的绑定,并且无法取消选中**使用现有 RKE 模板和修订版**。
### 更新模板
## 更新模板
更新 RKE 模板相当于创建现有模板的修订版。使用旧版本模板创建的集群可以进行更新,从而匹配新版本。
@@ -44,7 +43,7 @@ title: 创建和修改 RKE 模板
**结果**:模板已更新。要将其应用到使用旧版本模板的集群,请参阅[升级集群以使用新的模板修订版](#升级集群以使用新的模板修订版)。
### 删除模板
## 删除模板
当不再需要为任何集群使用某个 RKE 模板时,可以将其删除。
@@ -55,7 +54,7 @@ title: 创建和修改 RKE 模板
**结果**:模板被删除。
### 基于默认版创建新修订版
## 基于默认版创建新修订版
你可以复制默认模板修订版并快速更新其设置,而无需从头开始创建新修订版。克隆模板为你省去了重新输入集群创建所需的访问密钥和其他参数的麻烦。
@@ -66,7 +65,7 @@ title: 创建和修改 RKE 模板
**结果**:克隆并配置了 RKE 模板修订版。
### 基于克隆版创建新修订版
## 基于克隆版创建新修订版
通过用户设置创建新的 RKE 模板修订版时,可以克隆现有修订版并快速更新其设置,而无需从头开始创建新的修订版。克隆模板修订省去了重新输入集群参数的麻烦。
@@ -77,7 +76,7 @@ title: 创建和修改 RKE 模板
**结果**:克隆并配置了 RKE 模板修订版。你可以在配置集群时使用 RKE 模板修订。任何使用此 RKE 模板的现有集群都可以升级到此新版本。
### 禁用模板修订版
## 禁用模板修订版
当你不需要将 RKE 模板修订版本用于创建新集群时,可以禁用模板修订版。你也可以重新启用禁用了的修订版。
@@ -89,7 +88,7 @@ title: 创建和修改 RKE 模板
**结果**:RKE 模板修订版不能用于创建新集群。
### 重新启用禁用的模板修订版
## 重新启用禁用的模板修订版
如果要使用已禁用的 RKE 模板修订版来创建新集群,你可以重新启用该修订版。
@@ -99,7 +98,7 @@ title: 创建和修改 RKE 模板
**结果**:RKE 模板修订版可用于创建新集群。
### 将模板修订版设置为默认
## 将模板修订版设置为默认
当最终用户使用 RKE 模板创建集群时,他们可以选择使用哪个版本来创建集群。你可以配置默认使用的版本。
@@ -111,7 +110,7 @@ title: 创建和修改 RKE 模板
**结果**:使用模板创建集群时,RKE 模板修订版将用作默认选项。
### 删除模板修订版
## 删除模板修订版
你可以删除模板的所有修订(默认修订除外)。
@@ -123,7 +122,7 @@ title: 创建和修改 RKE 模板
**结果**:RKE 模板修订版被删除。
### 升级集群以使用新的模板修订版
## 升级集群以使用新的模板修订版
:::note
@@ -142,7 +141,7 @@ title: 创建和修改 RKE 模板
**结果**:集群已升级为使用新模板修订版中定义的设置。
### 将正在运行的集群导出到新的 RKE 模板和修订版
## 将正在运行的集群导出到新的 RKE 模板和修订版
你可以将现有集群的设置保存为 RKE 模板。
@@ -4,11 +4,11 @@ title: 配置 Active Directory (AD)
如果你的组织使用 Microsoft Active Directory 作为中心用户仓库,你可以将 Rancher 配置为与 Active Directory 服务器通信,从而对用户进行身份验证。这使 Rancher 管理员可以对外部用户系统中的用户和组进行集群和项目的访问控制,同时允许最终用户在登录 Rancher UI 时使用 Active Directory 凭证进行身份验证。
Rancher 使用 LDAP 与 Active Directory 服务器通信。因此,Active Directory 与 [OpenLDAP 身份验证](../../../../pages-for-subheaders/configure-openldap.md)的流程相同。
Rancher 使用 LDAP 与 Active Directory 服务器通信。因此,Active Directory 与 [OpenLDAP 身份验证](../configure-openldap/configure-openldap.md)的流程相同。
:::note
在开始之前,请熟悉[外部身份验证配置和主体用户](../../../../pages-for-subheaders/authentication-config.md#外部身份验证配置和用户主体)的概念。
在开始之前,请熟悉[外部身份验证配置和主体用户](./authentication-config.md#外部认证配置和用户主体)的概念。
:::
@@ -321,5 +321,5 @@ Rancher 未测试也未完全支持自定义端点。
>
> - 如果你不想在 Azure AD Graph API 停用后升级到 v2.7.0+,你需要:
> - 使用内置的 Rancher 身份认证,或者
> - 使用另一个第三方身份认证系统并在 Rancher 中进行设置。请参阅[身份验证文档](../../../../pages-for-subheaders/authentication-config.md),了解如何配置其他开放式身份验证提供程序。
> - 使用另一个第三方身份认证系统并在 Rancher 中进行设置。请参阅[身份验证文档](./authentication-config.md),了解如何配置其他开放式身份验证提供程序。
@@ -8,7 +8,7 @@ title: 配置 FreeIPA
- 你必须配置了 [FreeIPA 服务器](https://www.freeipa.org/)。
- 在 FreeIPA 中创建一个具有 `read-only` 访问权限的 ServiceAccount 。当用户使用 API​​ 密钥发出请求时,Rancher 使用此账号来验证组成员身份。
- 参见[外部身份验证配置和主体用户](../../../../pages-for-subheaders/authentication-config.md#外部身份验证配置和用户主体)。
- 参见[外部身份验证配置和主体用户](./authentication-config.md#外部认证配置和用户主体)。
:::
@@ -6,7 +6,7 @@ title: 配置 GitHub
:::note 先决条件:
参见[外部身份验证配置和主体用户](../../../../pages-for-subheaders/authentication-config.md#外部身份验证配置和用户主体)。
参见[外部身份验证配置和主体用户](./authentication-config.md#外部认证配置和用户主体)。
:::

Some files were not shown because too many files have changed in this diff Show More