Skip to content

Commit 59b90cf

Browse files
add more sandboxing documentation
1 parent 7d824f3 commit 59b90cf

File tree

3 files changed

+111
-82
lines changed

3 files changed

+111
-82
lines changed

pages/getting-started/advanced-config/sandboxing.md

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,30 @@ To set it up, you need to configure a few env vars as well, in particular:
3838

3939
To simplify permission management, you can also configure specific emails to automatically be made admins via another env var: `CONSOLE_ADMIN_EMAILS`. It should be a comma seperated list, and on login we'll provision that user to be an admin w/in your Plural console instance. We'd recommend only setting this for a small set of users, then using group bindings for permissions from then on
4040

41-
## Self-host git repos
41+
## Self-Host Git Repos
4242

43-
If your enterprise cannot accept external communication to github, we recommend vendoring the above repos into your own source control provider (most have a mechanism for doing this, or can always build a cron to do it as well which we're happy to help with).
43+
If your enterprise cannot accept external communication to github, we can provide a fully self-hosted git server built with [soft-serve](https://github.com/charmbracelet/soft-serve) with the required Plural repos pre-cloned at a compatible version for your instance of the console. This can be easily enabled via helm with the following values:
4444

45-
The deployment-operator and scaffolds repos were both designed to be forked or vendored. Once you've decided upon a strategy for both, you can configure them as repositories in your console, then go to https://{your-plural-console}/cd/settings/repositories and chose to rewire the relevant repos as needed. You can also just directly modify the url and authorization information for the https://github.com/pluralsh/deployment-operator.git and other repos if you'd like too.
45+
```yaml
46+
extraEnv:
47+
- name: CONSOLE_DEPLOY_OPERATOR_URL
48+
value: http://git-server.plrl-console:23232/deployment-operator.git # uses the git server for deployment operator updates
49+
- name: CONSOLE_ARITIFACTS_URL
50+
value: http://git-server.plrl-console:23232/scaffolds.git # uses the git server for our default service catalog setup artifacts
51+
gitServer:
52+
enabled: true
53+
```
54+
55+
We publish a new version of this every release so you will simply need to ensure it's vendored and ready to pull on each helm upgrade. Many organizations have a natural way to vendor docker images, and since this is deployed as a fully self-contained container image, you can simply repurpose that process to managing the necessary git repositories as well.
4656
47-
To reconfigure a self-managed repo for compatibilities and deprecations, you'll need to fork or vendor https://github.com/pluralsh/console then configure the `GITHUB_RAW_URL` env var to point to the new location. The current default is https://raw.githubusercontent.com/pluralsh/console. This will then be appended w/ the branch + path (eg "${GITHUB_RAW_URL}/master/static/compatibilities) to fetch the relevant data for both uis.
57+
If you want to vendor the repositories entirely, the upstream repos are here:
58+
59+
- https://github.com/pluralsh/deployment-operator
60+
- https://github.com/pluralsh/scaffolds
4861
49-
Alternatively, we also bundle the compatibility and deprecation data in our docker images, and you can disable live polling github by setting the env var:
62+
## Sandboxed Compatibility Tables
63+
64+
We also bundle the compatibility and deprecation data in our docker images, and you can disable live polling github by setting the env var:
5065
5166
```
5267
CONSOLE_AIRGAP: "true"
@@ -63,6 +78,7 @@ Lots of enterprises have strict requirements around the docker registries they u
6378
- pluralsh/deployment-controller
6479
- pluralsh/deployment-operator
6580
- pluralsh/agentk
81+
- pluralsh/git-server (optional if you want to use our vendored git server)
6682
6783
The first three will be configured in the main console chart and are installed once in your management cluster, the latter two are needed for your deployment agent pod, and require a bit more advanced configuration to manage them in bulk.
6884
@@ -110,42 +126,44 @@ First, you'll first want to use our agent settings to configure your helm update
110126

111127
![](/assets/deployments/agent-update.png)
112128

113-
When you're installing an agent on a new cluster, you'll want to specify your custom values so agent pods can properly bootstrap as well. You have two main options, install via cli or terraform. To configure custom values when using the cli, there's a `--values` flag that can point to a yaml file for your custom values, eg something like:
129+
This can also be set via CRD using:
114130

115-
```bash
116-
plural cd clusters bootstrap --name my-new-cluster --values ./agent-values.yaml
131+
```yaml
132+
apiVersion: deployments.plural.sh/v1alpha1
133+
kind: DeploymentSettings
134+
metadata:
135+
name: global # this is a singleton resource that is always at this location
136+
namespace: plrl-deploy-operator
137+
spec:
138+
agentHelmValues: # from values above
139+
image:
140+
repository: your.enterprise.registry/pluralsh/deployment-operator
141+
142+
# configure agentk (if this isn't pullable kubernetes dashboarding functionality will break but deployments can still proceed)
143+
agentk:
144+
image:
145+
repository: your.enterprise.registry/pluralsh/agentk
117146
```
118147

119-
This will merge in those values with the chart, and you can use the example yaml above to jumpstart writing the exact spec you need.
120-
121-
For terraform, our provider also supports passing custom values like the following for eks:
148+
From there, both our CLI and terraform provider will ensure these helm values are always applied either in a direct agent install with:
122149

123-
```tf
124-
data "aws_eks_cluster" "cluster" {
125-
name = var.cluster_name
126-
}
150+
```bash
151+
plural cd clusters bootstrap --name my-new-cluster
152+
```
127153

128-
data "aws_eks_cluster_auth" "cluster" {
129-
name = var.cluster_name
130-
}
154+
or via terraform with:
131155

132-
# store agent values in an adjacent file for the purpose of this example
133-
data "local_file" "agent_values" {
134-
filename = "${path.module}/../helm-values/agent.yaml"
135-
}
136-
137-
# this creates the cluster in our api, then performs a helm install w/ the agent chart in one tf resource
156+
```tf
138157
resource "plural_cluster" "my-cluster" {
139158
handle = "my-cluster"
140-
name = var.cluster_name
141-
tags = var.tags
159+
name = "my-cluster"
160+
161+
tags = {
162+
tier = "dev"
163+
fleet = "my-fleet"
164+
}
142165
143-
helm_values = data.local_file.agent_values.content # can also just be passed as a raw string instead of using the file import method
166+
kubeconfig = { ... }
144167
145-
kubeconfig = {
146-
host = data.aws_eks_cluster.cluster.endpoint
147-
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data)
148-
token = data.aws_eks_cluster_auth.cluster.token
149-
}
150168
}
151-
```
169+
```

pages/getting-started/first-steps/cli-quickstart.md

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,45 +60,13 @@ We've also generated a README that should give an overview of how the repo can b
6060
If you'd like to configure the plural cli to communicate with your new Console instance, the configuration process is pretty simple, you'll need to set your Console URL and Console token. Set them with:
6161

6262
```
63-
PLURAL_CONSOLE_URL
64-
PLURAL_CONSOLE_TOKEN
63+
plural cd login
6564
```
6665

67-
or alternatively you can run `plural cd login` to set them to a config file within `~/.plural`
68-
6966
{% callout severity="info" %}
70-
`plural cd` is an alias for `plural deployments`, and can be used interchangeably within the CLI.
67+
You'll need to generate an access token to perform this command, it'll be available at https://{your-console-url}/profile/access-tokens
7168
{% /callout %}
7269

73-
## List Clusters, Services, Repositories
74-
75-
The following commands can help you list a lot of the clusters, services, etc that have already been registered:
76-
77-
```sh
78-
plural cd clusters list
79-
plural cd services list @{cluster-handle}
80-
plural cd repositories list
81-
```
82-
83-
## Import Git Repositories and Deploy services
84-
85-
You'll need to then import the Git repository containing your service and the associated Kubernetes manifests. To do so, use `plural cd repositories create`:
86-
87-
```sh
88-
plural cd repositories create --url <REPO_URL>
89-
```
90-
91-
Optionally add flags for Github authorization if necessary.
92-
93-
To then deploy your service, find the repo ID for the service you want to deploy using `plural cd repositories list`.
94-
95-
You can then use the `plural cd services create` command:
96-
97-
```sh
98-
plural cd services create --name <SERVICE_NAME> --namespace <SERVICE_NAMESPACE> --repo-id <REPO_ID> --git-ref <GIT_REF> --git-folder <GIT_FOLDER> CLUSTER_ID
99-
100-
```
101-
102-
See deployed services with the `plural cd services list` command. Your service should populate initially as `Stale` until your components are Ready, at which point they will flip to `Healthy`.
70+
or alternatively you can run the env vars `PLURAL_CONSOLE_URL` and `PLURAL_CONSOLE_TOKEN` or set them directly in the config file `~/.plural/console.yml`
10371

104-
Congratulations! You've deployed your first service with Plural.
72+
To validate your cli is properly configured, simply run `plural cd clusters list`

pages/getting-started/first-steps/existing-cluster.md

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@ kubectl create secret generic console-values --from-file=values.yaml=values.secr
8484
2. Create a helm service referencing it in a folder currently being synced via GitOps:
8585

8686
```yaml
87-
apiVersion: source.toolkit.fluxcd.io/v1beta2
88-
kind: HelmRepository
89-
metadata:
90-
name: console
91-
namespace: infra # or whatever namespace you prefer
92-
spec:
93-
interval: 5m0s
94-
url: https://pluralsh.github.io/console
9587
---
9688
apiVersion: deployments.plural.sh/v1alpha1
9789
kind: Cluster
@@ -110,14 +102,12 @@ spec:
110102
namespace: plrl-console # this namespace must be correct
111103
name: console
112104
helm:
113-
version: 0.3.x # can use floating versions with the .x syntax or pin to specific versions and automate w/ renovate
105+
version: 0.x.x # VERSION (will be used below, 0.x.x means we float minor and patch versions)
114106
chart: console
107+
url: https://pluralsh.github.io/console
115108
valuesFrom:
116109
namespace: infra
117-
name: console-values
118-
repository:
119-
namespace: infra
120-
name: console # referenced helm repository above
110+
name: console-values # maps to the secret we created above
121111
clusterRef:
122112
kind: Cluster
123113
name: mgmt # must be set to your management cluster
@@ -126,3 +116,56 @@ spec:
126116
127117
You can then add additional values configuration using the `values` field of a helm service, or convert it to a multi-source service and source values files directly from git.
128118

119+
## Generate Console Update PRs instead of floating versions
120+
121+
If you want to pin your console version and generate PRs instead of auto-updating, you can use the following Plural CRs to automate that entirely:
122+
123+
```yaml
124+
apiVersion: deployments.plural.sh/v1alpha1
125+
kind: PrAutomation
126+
metadata:
127+
name: console-upgrader
128+
spec:
129+
name: console-upgrader
130+
documentation: Updates the console service to a new helm version
131+
updates:
132+
regexReplacements:
133+
- regex: "version: (.*) # VERSION" # the VERSION comment is simply to assist regex replacement here
134+
file: bootstrap/console.yaml # rewrite to whatever the actual version of your console is
135+
replacement: "version: {{ context.version }} # VERSION"
136+
scmConnectionRef:
137+
name: workspaces
138+
title: "Update Plural Console helm chart to {{ context.version }}"
139+
message: |
140+
Update Plural Console helm chart to {{ context.version }}
141+
142+
Release notes available here: https://github.com/pluralsh/console/releases
143+
identifier: ${YOUR_REPO_SLUG} # eg pluralsh/plrl-infra
144+
configuration:
145+
- name: version
146+
type: STRING
147+
documentation: version of the new helm chart
148+
---
149+
apiVersion: deployments.plural.sh/v1alpha1
150+
kind: Observer
151+
metadata:
152+
name: console
153+
spec:
154+
crontab: "*/5 * * * *"
155+
initial: '0.3.81' # or whatever your current chart version is
156+
target:
157+
order: SEMVER
158+
type: HELM
159+
helm:
160+
url: https://pluralsh.github.io/console
161+
chart: console
162+
actions:
163+
- type: PR
164+
configuration:
165+
pr:
166+
prAutomationRef:
167+
name: console-upgrader # references the PrAutomation CR we created above
168+
namespace: infra
169+
context:
170+
version: $value
171+
```

0 commit comments

Comments
 (0)