Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clusters Concepts page #1330

Merged
merged 45 commits into from
Jun 20, 2024
Merged

Clusters Concepts page #1330

merged 45 commits into from
Jun 20, 2024

Conversation

ZPain8464
Copy link
Contributor

@ZPain8464 ZPain8464 commented Mar 26, 2024

This PR adds a Clusters Concepts page, which covers all the relevant details about a cluster that users might want to know.

Copy link

netlify bot commented Mar 26, 2024

Deploy Preview for pomerium-docs ready!

Name Link
🔨 Latest commit e50ca6a
🔍 Latest deploy log https://app.netlify.com/sites/pomerium-docs/deploys/66748333100aed0008ae71d1
😎 Deploy Preview https://deploy-preview-1330--pomerium-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


### Cluster identity

When you create an account in Pomerium Zero, a new cluster with its own **Cluster Identity** is generated and assigned to your personal account. Pomerium Zero tethers this cluster to your account with the **Pomerium Zero Token** value provided to you during onboarding.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments:

  • It feels a little off to say that a cluster is "generated" by Pomerium Zero if we define "cluster" above to mean "a single Pomerium deployment." (That is, the user is the one that sets up a cluster, not Pomerium Zero.)

    I think it might be clearer to say that Pomerium Zero generates a "cluster token" which can be used to deploy a new cluster.

  • I'm not sure I understand what "tethers this cluster to your account" means. I'd recommend we replace Cluster Identity and Pomerium Zero Token with just "cluster token".


TODO: It would be ideal to get an architecture diagram here.

### Cluster identity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest we standardize on the term "cluster token" for this concept, but open to feedback from others.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1


When you create an account in Pomerium Zero, a new cluster with its own **Cluster Identity** is generated and assigned to your personal account. Pomerium Zero tethers this cluster to your account with the **Pomerium Zero Token** value provided to you during onboarding.

This cluster identity token acts as a refresh token that you can use to generate a new cluster identity token in the Zero Console (see the [**Rotate cluster identity**](#rotate-cluster-identity) steps below).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that it's helpful to talk about refresh tokens here. You don't really "use" a cluster token when generating a new one — I think it would be more accurate to say something along the lines of "generating a new cluster token invalidates the existing cluster token."

<li>Under **Actions**, select the **edit** icon</li>
<li>Select the **Domains** tab</li>
<li>In the **Cluster Identity** field, select **Rotate Identity**</li>
<li>Copy the token and replace the old one in your configuration file</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll want to expand on these instructions to include more details specific to the installation type (Linux install script, Kubernetes, Docker Compose).

We may also want to include instructions for how to restart Pomerium after updating the configuration.


#### Rotate cluster identity

A cluster identity token does not have a set expiration time. However, you may want to rotate the cluster identity in the Zero Console for security reasons. After you rotate the cluster identity, the previous token becomes obsolete.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's probably worth talking a little more about security.

  • What are the risks if a cluster token is exposed?


### Cluster domain

Pomerium Zero generates and assigns a unique **Cluster Domain** to your cluster. Your cluster domain contains your randomly generated **Cluster Name** and the `pomerium.app` subdomain.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's think about how we want to talk about this. We might want to use terminology like "starter domain" when referring to the randomly generated domain.


#### Change cluster Name

If you don't like your randomly generated cluster name, you can change it manually in your cluster settings.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this almost reads like you can change the starter domain by changing the cluster name, which I don't think is the case.

I wonder if this would be a good place to instead link to a guide for adding a custom domain.

1. Run `docker compose up -d`

</TabItem>
<TabItem value="kubernetes" label="Kubernetes">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to confirm these steps are accurate for K8s.


![Viewing the new cluster name in the Zero Console](./img/clusters/cluster-name-table.png)

#### Detected and Override IP address
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think we should include this section here. At a minimum, we should cover these steps in Troubleshooting, or cross-link these pages.


## Clusters overview

A **Cluster** represents a single Pomerium deployment managed by Pomerium Zero, our hosted control plane. Pomerium Zero enables you to configure cluster settings for your personal account or organization.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can think of a Pomerium cluster as a completely distinct deployment of Pomerium, and allows you to effectively shard you deployments for performance, governance, security, or management purposes.

I think we should probably discuss common reasons people would want to use a cluster.


### Cluster architecture

TODO: It would be ideal to get an architecture diagram here.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An entity diagram would make the relationship more obvious.

@ZPain8464 ZPain8464 marked this pull request as ready for review April 3, 2024 20:55
@ZPain8464 ZPain8464 requested a review from a team as a code owner April 3, 2024 20:55
@ZPain8464 ZPain8464 requested a review from desimone April 3, 2024 20:55
@ZPain8464
Copy link
Contributor Author

I could use some input on the "Why clusters" section. It's pretty thin. The other TODOs would be to add a video, clusters architecture, and links for pending pages.

Copy link
Collaborator

@desimone desimone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Zero Console/Pomerium Zero/h

content/docs/concepts/clusters.mdx Outdated Show resolved Hide resolved
content/docs/concepts/clusters.mdx Outdated Show resolved Hide resolved
content/docs/concepts/clusters.mdx Outdated Show resolved Hide resolved
content/docs/concepts/clusters.mdx Outdated Show resolved Hide resolved
content/docs/concepts/clusters.mdx Outdated Show resolved Hide resolved

### Simplified configuration

Cluster configuration is managed entirely in the Zero Console. As you apply configuration changes in the Zero Console, your cluster fetches and applies these changes locally.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intent is to say that this information is managed in Pomerium Zero's control plane correct?

This instead reads like configuration for clusters is managed exclusively in the web ui (which isn' tthe case).

content/docs/concepts/clusters.mdx Outdated Show resolved Hide resolved
content/docs/concepts/clusters.mdx Outdated Show resolved Hide resolved
content/docs/concepts/clusters.mdx Outdated Show resolved Hide resolved
content/docs/concepts/clusters.mdx Outdated Show resolved Hide resolved

## Overview

A **Cluster** represents a single Pomerium deployment managed by Pomerium Zero, our hosted control plane. You can think of a Pomerium cluster as a completely distinct deployment of Pomerium that allows you to effectively shard your deployments for performance, governance, security, or management purposes.
When you deploy Pomerium Zero, you get your own **Cluster**. A cluster consists of one or more replicas of [Pomerium Core](/docs/deploy/core), the primary server component that secures your services. Clusters are deployed locally and managed through the **Zero Console**, a remote control plane hosted in the Pomerium Zero cloud.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if "you deploy Pomerium Zero" is an accurate statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated to "install".

content/docs/concepts/clusters.mdx Show resolved Hide resolved

- A malicious insider could use the token to view the cluster's configuration, which may contain sensitive data
When you deploy a cluster in Pomerium Zero, a **Cluster Token** is generated for you during onboarding. The cluster token environment variable instructs Pomerium to run in a special "Zero-managed" mode. In Zero-managed mode, your cluster connects to the Pomerium Zero cloud, where you can manage your cluster from the Zero Console.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not just "during onboarding"

- You may lose track of the existing token, and want a new one

:::caution

Rotating the cluster identity will invalidate the existing cluster token.
Rotating the cluster token will invalidate the current token.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Rotating the cluster token will invalidate the current token.
Rotating the cluster token will invalidate the current token.
Suggested change
Rotating the cluster token will invalidate the current token.
Rotating the cluster token will invalidate the current token, and make your cluster shut down.

### Cluster domain
### Detected and Override IP Address

Whenever you start a cluster, it must fetch its configuration from the Zero Console. During this process, Pomerium attempts to detect the cluster's outbound IP address to connect to it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pomerium core connects to pomerium cloud, thus we do not need to know the IP address for connection purposes.

what I think we need to elaborate is that every cluster gets an automatic domain, and the detected IP address would be set as A or AAAA records for that domain, unless user provided an override value.

- Behind a firewall
- In a Kubernetes server where the ingress load balancer IP address doesn't match the egress IP address

In such cases, you may see a `DNS_PROBE_FINISHED_NXDOMAIN` error in your browser when you access a route. As a workaround, we've provided the **Override IP Address** field, which allows you to manually set the IP address so that Pomerium Zero can connect to your cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the DNS_PROBE_FINISHED_NXDOMAIN error means there's no record available.

it may only show up if we just updated the domain name and changes did not yet propagate to the user's machine, or the cluster was not yet ever connected to the cloud, meaning we do not know the IP address.

the override IP address is indeed required for the cases listed above, but the error in the browser would be different, specifically ERR_CONNECTION_REFUSED - as the cluster is running, but is unreachable using the automatically detected IP address.


![The Cluster Cert window in the Zero Console](./img/certificates/cluster-cert-details.png)
You can't deploy replicas in the Zero Console itself. To deploy a replica, run the Pomerium Zero installation script using the same [cluster token](#cluster-token) you used to deploy your cluster. This will generate another replica, which you can verify on the [**Status**](https://console.pomerium.app/app/reports/status) page.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there seems to be a contradiction in wording: "You can't deploy replicas", followed by "To deploy a replica".

A replica is simply an instance of Pomerium Core deployed on another host.

@ZPain8464
Copy link
Contributor Author

@wasaga if I could get a review sometime this afternoon, that'd be great.


Each replica runs Pomerium Core in an all-in-one mode, meaning the services that comprise Core are deployed together and share session state. Similarly, replicas communicate with each other to synchronize state across a cluster.

The interconnectivity between replicas enables you to horizontally scale your cluster to adapt to the purposes of your use case, be it performance, governance, security, or management related.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the only reason to have multiple replicas is scaling workloads and higher availability. it does not have additional security or management benefits

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the text. Thanks for the in-depth review/s, @wasaga.

@ZPain8464 ZPain8464 changed the title Clusters Concepts page - Draft 3 Clusters Concepts page Jun 20, 2024
@ZPain8464 ZPain8464 merged commit 969960b into main Jun 20, 2024
8 checks passed
@ZPain8464 ZPain8464 deleted the zpain/clusters-concepts branch June 20, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants