Skip to content

Commit 087a31a

Browse files
Document setting up grafana agent, github runners, split ingress (#244)
Documenting some more advanced workflows around setting up monitoring, ingress, self-hosted github actions runners.
1 parent a6305b2 commit 087a31a

File tree

6 files changed

+120
-0
lines changed

6 files changed

+120
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Advanced Configuration
3+
description: Fine-tuning your Plural Console to meet your requirements
4+
---

pages/deployments/ci-gh-actions.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,41 @@ plural cd services update @{cluster-handle}/{service-name} --conf {name}={value}
2929

3030
Feel free to run `plural cd services update --help` for more documentation as well.
3131

32+
## Self-Hosted Runners
33+
34+
Many users will want to host their console in a private network. If that's the case, a standard hosted Github Actions runner will not be able to network to the console api and allow the execution of the `plural cd` commands. The solution for this is to leverage github's self-hosted runners to allow you to run the Actions in an adjacent network and maintain the security posture of your console. We've added a few add-ons to make this setup trivially easy to handle, you'll want to:
35+
36+
- install the `github-actions-controller` runner to set up the k8s operator that manages runners in a cluster. You likely want this to be installed in your management cluster for network adjacency.
37+
- install the `plrl-github-actions-runner` in that same cluster to create a runner set you can schedule jobs on.
38+
39+
Once both are deployed, you can create your first job, it'll likely look something like this:
40+
41+
```yaml
42+
jobs:
43+
# some previous jobs...
44+
update-service:
45+
needs: [docker-build]
46+
runs-on: plrl-github-actions-runner
47+
env:
48+
PLURAL_CONSOLE_TOKEN: ${{ secrets.PLURAL_CONSOLE_TOKEN }}
49+
PLURAL_CONSOLE_URL: ${{ secrets.PLURAL_CONSOLE_URL }}
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
- name: installing plural
54+
uses: pluralsh/[email protected]
55+
- name: Using short sha
56+
run: echo ${GITHUB_SHA::7}
57+
- name: Update service
58+
run: plural cd services update @mgmt/marketing --conf tag=sha-${GITHUB_SHA::7}
59+
```
60+
61+
Note that the `runs-on` job attribute is what specifies this as using the plrl-github-actions runner. It's worth also looking into some of the control mechanisms Github provides to gate what repositories and workflows can leverage self-hosted runners to manage the security tradeoffs it poses.
62+
63+
{% callout severity="warning" %}
64+
Github recommends you don't use self-hosted runners on public repositories due to the complexity required to prevent workflows from being run by fork repository pull requests.
65+
{% /callout %}
66+
3267
## Addendum
3368

3469
Since the plural cli is a standalone go binary, it can easily be injected in any CI framework in much the same way by installing it and the executing the appropriate cli command to modify your service once a deployable artifact has been built.

pages/deployments/monitoring-addons.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,18 @@ description: Set up common monitoring agents
88
The `datadog` add-on will automatically install Datadog's onto a cluster for you. You can also create a global service to automate installing the agent throughout your fleet. It will ask for your datadog api and app keys, and automatically inject them into the agent. We'll also manage future upgrades of the agent so you don't have to.
99

1010
Once the agent is installed, there are often additional features that need to be enabled to get the full Datadog ecosystem functioning. We recommend visiting their docs [here](https://docs.datadoghq.com/containers/kubernetes/installation/?tab=operator#next-steps)
11+
12+
## Grafana Agent
13+
14+
The `grafana-agent` add-on will deploy an instance of grafana's metrics agent on a cluster in a self-serviceable way. The agent simplifies the process of configuring remote writes for prometheus (without needing a full prometheus db) and also integrates with the standard coreos `ServiceMonitor` and `PodMonitor` CRDs.
15+
16+
Our configuration for the agent will ask you to:
17+
18+
- input hostname and basic auth information for prometheus
19+
- input hostname and basic auth information for loki
20+
21+
And will immediately start shipping logs to both on your behalf. We'd recommend also leveraging our global service setup to simplify rolling it out to your entire fleet. You'll be able to distinguish metrics via the `cluster` label in both Loki and Prometheus, which will map to the cluster handle attribute to ensure it's human-readable.
22+
23+
If you haven't set up Loki or Prometheus, and you created your console via Plural, we recommend using our Mimir and Loki setups in the Plural marketplace. They're completely self-serviceable and will properly configure the underlying S3/GCS/Azure Blob Storage needed to persist the metrics data. In addition, our Grafana distribution auto-integrates them as datasources, so there's no additional setup needed there.
24+
25+
If you set up your console via BYOK, then feel free to let us know and we can help you set them up as part of our support packages.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Network Configuration
3+
description: Modifying ingress controller and setting up public/private endpoints for your console
4+
---
5+
6+
## Overview
7+
8+
There are a few strategies you can take to harden the network security of your console or align it with how you typically secure kubernetes ingresses. We'll note a few of these here.
9+
10+
## Bringing Your Own Ingress
11+
12+
Our helm chart has the ability to reconfigure the ingress class for your console. This could be useful if you already have an ingress controller with CIDR ranges and WAF setups built in. The helm values change is relatively simple, simply do:
13+
14+
```yaml
15+
ingress:
16+
ingressClass: <new-ingress-class>
17+
# potentially you might also want to add some annotations
18+
annotations:
19+
new.ingress.annotations: <value>
20+
21+
kas:
22+
ingress:
23+
ingressClass: <new-ingress-class>
24+
```
25+
26+
Both KAS and the console leverage websockets for some portion of their functionality. In the case of the console, the websockets are also far more performant with connection stickiness in place. Some ingress controllers have inconsistent websocket support (or require paid versions to unlock it), which is worth keeping in mind.
27+
28+
Also we do configure the ingresses with cert-manager by default. Some orgs will set a wildcard cert at the ingress level, in which case you'd want to disable the ingress-level certs.
29+
30+
## Public/Private Ingress
31+
32+
Another setup we support is splitting the console ingress between public and private. This allows you to host the entirety of the Console's api in a private network, while exposing a subset needed to serve the apis for the deployment agents to poll our APIs. These apis are minimal, they only provide:
33+
34+
- read access to the services deployable to an agent
35+
- a ping endpoint for a given cluster sending the cluster version and a timestamp
36+
- the ability to update the components created for a service by an agent
37+
38+
This is a relatively easy way to ensure network connectivity to end clusters in a pretty broad network topology, but there are of course other more advanced setups a team can attempt. The basic setup for this is as follows:
39+
40+
```yaml
41+
ingress:
42+
ingressClass: internal-nginx # or another private ingress controller
43+
44+
externalIngress:
45+
hostname: console-ext.your.subdomain # or whatever you'd like to rename it
46+
```
47+
48+
This will create a second, limited ingress exposing only the apis listed above via path routing. In this world, we'd also recommend you leave the KAS service also on a similar network as the external ingress.
49+
50+
There are still additional tactics you can use to harden this setup, for instance adding CIDR ranges for the NAT gateways of all the networks the clusters you wish to deploy to reside on can provide robust firewalling for the ingresses you'd configured.

src/NavData.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ const rootNavData: NavMenu = deepFreeze([
8080
href: '/deployments/existing-cluster',
8181
title: 'Set Up on your own Cluster',
8282
},
83+
{
84+
href: '/deployments/advanced-configuration',
85+
title: 'Advanced Configuration',
86+
sections: [
87+
{
88+
title: 'Network Configuration',
89+
href: '/deployments/network-configuration',
90+
},
91+
],
92+
},
8393
],
8494
},
8595
{

src/generated/pages.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
{
8787
"path": "/deployments/addons"
8888
},
89+
{
90+
"path": "/deployments/advanced-configuration"
91+
},
8992
{
9093
"path": "/deployments/architecture"
9194
},
@@ -152,6 +155,9 @@
152155
{
153156
"path": "/deployments/network-addons"
154157
},
158+
{
159+
"path": "/deployments/network-configuration"
160+
},
155161
{
156162
"path": "/deployments/operations"
157163
},

0 commit comments

Comments
 (0)