Skip to content

Commit f9089d9

Browse files
authored
Update install scheme pages to reflect selected Cloud URL (#286)
* Update CLI install scheme to update URLs based on selected Cloud Signed-off-by: Dom Del Nano <ddelnano@gmail.com> (cherry picked from commit 58a19b0) * Fix linting Signed-off-by: Dom Del Nano <ddelnano@gmail.com> * Rename componet to be more generic. Pass code block via property to avoid MDX library issues Signed-off-by: Dom Del Nano <ddelnano@gmail.com> * Update helm and YAML install instructions to incorporate cloud selector drop down Signed-off-by: Dom Del Nano <ddelnano@gmail.com> * Update docs to use PX_CLOUD_ADDR instead of legacy equivalent Signed-off-by: Dom Del Nano <ddelnano@gmail.com> * Rename placeholder used for cloud templating from @@ to @Placeholder@ Signed-off-by: Dom Del Nano <ddelnano@gmail.com> * Remove PX_CLOUD_ADDR reference from self hosted instructions Signed-off-by: Dom Del Nano <ddelnano@gmail.com> --------- Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 58f6c67 commit f9089d9

9 files changed

Lines changed: 82 additions & 57 deletions

File tree

content/en/02-installing-pixie/03-install-guides/01-hosted-pixie/01-cosmic-cloud.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ To deploy Pixie using the CLI:
4747
</Alert>
4848

4949
```bash
50-
# PL_CLOUD_ADDR must be set before any pixie cli commands are run!
51-
export PL_CLOUD_ADDR=getcosmic.ai
50+
# PX_CLOUD_ADDR must be set before any pixie cli commands are run!
51+
export PX_CLOUD_ADDR=getcosmic.ai
5252

5353
# List Pixie deployment options.
5454
px deploy --help

content/en/02-installing-pixie/03-install-guides/02-self-hosted-pixie/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Add users to your organization to share access to Pixie Live Views, query runnin
146146
1. Set the cloud address with an environment variable. If you configured a custom domain name, use that as the variable's value:
147147
148148
```bash
149-
export PL_CLOUD_ADDR=dev.withpixie.dev
149+
export PX_CLOUD_ADDR=dev.withpixie.dev
150150
```
151151
152152
1. Install Pixie's CLI. The easiest way to install Pixie's CLI is using the install script:

content/en/02-installing-pixie/04-install-schemes/01-cli.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,22 +103,21 @@ rpm -i pixie-px.x86_64.rpm
103103
Please refer to <a href="/reference/admin/environment-configs">Environment-Specific Configurations</a> for other configurations that should be set for your specific Kubernetes environment.
104104
</Alert>
105105

106-
```bash
106+
<TemplatedCodeBlock
107+
code={`
107108
# List Pixie deployment options.
108-
px deploy --help
109-
109+
px deploy --help \n
110110
# Deploy the Pixie Platform in your K8s cluster (No OLM present on cluster).
111-
export PL_CLOUD_ADDR=<getcosmic.ai or withpixie.ai>
112-
px deploy
113-
111+
export PX_CLOUD_ADDR=@PLACEHOLDER@
112+
px deploy \n
114113
# Deploy the Pixie Platform in your K8s cluster (OLM already exists on cluster).
115-
export PL_CLOUD_ADDR=<getcosmic.ai or withpixie.ai>
116-
px deploy --deploy_olm=false
117-
114+
export PX_CLOUD_ADDR=@PLACEHOLDER@
115+
px deploy --deploy_olm=false \n
118116
# Deploy Pixie with a specific memory limit (2Gi is the default, 1Gi is the minimum recommended)
119-
export PL_CLOUD_ADDR=<getcosmic.ai or withpixie.ai>
117+
export PX_CLOUD_ADDR=@PLACEHOLDER@
120118
px deploy --pem_memory_limit=1Gi
121-
```
119+
`}
120+
/>
122121

123122
Pixie will deploy pods to the `pl`, `px-operator`, and `olm`(if deploying the OLM) namespaces.
124123

content/en/02-installing-pixie/04-install-schemes/02-yaml.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ The CLI is used to get Pixie's YAML files. You can install the Pixie CLI followi
1919

2020
Check if your K8s cluster meets Pixie's [requirements](/installing-pixie/requirements) by running:
2121

22-
```bash
22+
<TemplatedCodeBlock
23+
code={`
24+
export PX_CLOUD_ADDR=@PLACEHOLDER@
2325
px deploy --check_only
24-
```
26+
`}
27+
/>
2528

2629
If your cluster fails any checks, you may still proceed with installation, but it is unlikely that Pixie will work on your cluster.
2730

@@ -45,20 +48,21 @@ Run the following CLI command to extract Pixie's manifest files:
4548
Please refer to <a href="/reference/admin/environment-configs">Environment-Specific Configurations</a> for other configurations that should be set for your specific Kubernetes environment.
4649
</Alert>
4750

48-
```bash
51+
<TemplatedCodeBlock
52+
code={`
4953
# Extract YAML (No OLM present on cluster).
50-
px deploy --extract_yaml ./ --deploy_key <PIXIE_DEPLOYMENT_KEY>
51-
54+
export PX_CLOUD_ADDR=@PLACEHOLDER@
55+
px deploy --extract_yaml ./ --deploy_key <PIXIE_DEPLOYMENT_KEY> \n
5256
# Extract YAML (OLM already exists on cluster).
53-
px deploy --extract_yaml ./ --deploy_key <PIXIE_DEPLOYMENT_KEY> --deploy_olm=false
54-
57+
export PX_CLOUD_ADDR=@PLACEHOLDER@
58+
px deploy --extract_yaml ./ --deploy_key <PIXIE_DEPLOYMENT_KEY> --deploy_olm=false \n
5559
# Extract YAML (Self-hosting Pixie Cloud).
56-
px deploy --extract_yaml ./ --deploy_key <PIXIE_DEPLOYMENT_KEY> --dev_cloud_namespace plc
57-
60+
px deploy --extract_yaml ./ --deploy_key <PIXIE_DEPLOYMENT_KEY> --dev_cloud_namespace plc \n
5861
# Extract YAML (configure Pixie with a specific memory limit - 2Gi is the default, 1Gi is the minimum recommended)
62+
export PX_CLOUD_ADDR=@PLACEHOLDER@
5963
px deploy --extract_yaml ./ --deploy_key <PIXIE_DEPLOYMENT_KEY> --pem_memory_limit=1Gi
60-
61-
```
64+
`}
65+
/>
6266

6367
**Note:** The extracted YAMls does not include manifests for each sub-component of Pixie. It includes manifests for etcd, NATS and the cloud-connector service which downloads the manifests for the necessary services and daemonsets.
6468

@@ -82,13 +86,13 @@ For more deploy options that you can specify to configure Pixie, refer to our [d
8286

8387
To verify that Pixie is running in your environment you can check the <CloudLink url="/admin">admin page</CloudLink> or run:
8488

85-
```bash
89+
<TemplatedCodeBlock
90+
code={`
8691
# Check pods are up
87-
kubectl get pods -n pl
88-
89-
# Check Pixie Platform status
92+
kubectl get pods -n pl \n
93+
# Check Pixie Platform and PEM status
94+
export PX_CLOUD_ADDR=@PLACEHOLDER@
9095
px get viziers
91-
92-
# Check PEM stats
9396
px get pems
94-
```
97+
`}
98+
/>

content/en/02-installing-pixie/04-install-schemes/03-helm.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ Install the Pixie CLI following the directions [here](/installing-pixie/install-
2121

2222
Check if your K8s cluster meets Pixie's [requirements](/installing-pixie/requirements) by running:
2323

24-
```bash
24+
<TemplatedCodeBlock
25+
code={`
26+
export PX_CLOUD_ADDR=@PLACEHOLDER@
2527
px deploy --check_only
26-
```
28+
`}
29+
/>
2730

2831
If your cluster fails any checks, you may still proceed with installation, but it is unlikely that Pixie will work on your cluster.
2932

@@ -47,25 +50,22 @@ Deploy Pixie in your target cluster by running:
4750
Please refer to <a href="/reference/admin/environment-configs">Environment-Specific Configurations</a> for other configurations that should be set for your specific Kubernetes environment.
4851
</Alert>
4952

50-
```bash
53+
<TemplatedCodeBlock
54+
code={`
5155
# Add the Pixie operator chart.
52-
helm repo add pixie-operator https://artifacts.px.dev/helm_charts/operator
53-
56+
helm repo add pixie-operator https://artifacts.px.dev/helm_charts/operator \n
5457
# Get latest information about Pixie chart.
55-
helm repo update
56-
58+
helm repo update \n
5759
# Install the Pixie chart (No OLM present on cluster).
58-
helm install pixie pixie-operator/pixie-operator-chart --set cloudAddr=<getcosmic.ai:443 or withpixie.ai:443> --set deployKey=<deploy-key-goes-here> --set clusterName=<cluster-name> --namespace pl --create-namespace
59-
60+
helm install pixie pixie-operator/pixie-operator-chart --set cloudAddr=@PLACEHOLDER@ --set deployKey=<deploy-key-goes-here> --set clusterName=<cluster-name> --namespace pl --create-namespace \n
6061
# Install the Pixie chart (OLM already exists on cluster).
61-
helm install pixie pixie-operator/pixie-operator-chart --set cloudAddr=<getcosmic.ai:443 or withpixie.ai:443> --set deployKey=<deploy-key-goes-here> --set clusterName=<cluster-name> --namespace pl --create-namespace --set deployOLM=false
62-
62+
helm install pixie pixie-operator/pixie-operator-chart --set cloudAddr=@PLACEHOLDER@ --set deployKey=<deploy-key-goes-here> --set clusterName=<cluster-name> --namespace pl --create-namespace --set deployOLM=false \n
6363
# Install the Pixie chart (Self-hosting Pixie Cloud)
64-
helm install pixie pixie-operator/pixie-operator-chart --set deployKey=<deploy-key-goes-here> --set clusterName=<cluster-name> --namespace pl --create-namespace --set devCloudNamespace=plc
65-
64+
helm install pixie pixie-operator/pixie-operator-chart --set deployKey=<deploy-key-goes-here> --set clusterName=<cluster-name> --namespace pl --create-namespace --set devCloudNamespace=plc \n
6665
# Install Pixie with a memory limit for the PEM pods (per node). 2Gi is the default, 1Gi is the minimum recommended.
67-
helm install pixie pixie-operator/pixie-operator-chart --set cloudAddr=<getcosmic.ai:443 or withpixie.ai:443> --set deployKey=<deploy-key-goes-here> --set clusterName=<cluster-name> --namespace pl --create-namespace --set deployOLM=false --set pemMemoryLimit=1Gi
68-
```
66+
helm install pixie pixie-operator/pixie-operator-chart --set cloudAddr=@PLACEHOLDER@ --set deployKey=<deploy-key-goes-here> --set clusterName=<cluster-name> --namespace pl --create-namespace --set deployOLM=false --set pemMemoryLimit=1Gi
67+
`}
68+
/>
6969

7070
Pixie will deploy pods to the `pl`, `px-operator`, and `olm`(if deploying the OLM) namespaces.
7171

@@ -92,13 +92,13 @@ helm install pixie pixie-vizier/vizier-chart --set deployKey=<deploy-key-goes-he
9292

9393
To verify that Pixie is running in your environment you can check the <CloudLink url="/admin">admin page</CloudLink> or run:
9494

95-
```bash
95+
<TemplatedCodeBlock
96+
code={`
9697
# Check pods are up
97-
kubectl get pods -n pl
98-
99-
# Check Pixie Platform status
98+
kubectl get pods -n pl \n
99+
# Check Pixie Platform and PEM status
100+
export PX_CLOUD_ADDR=@PLACEHOLDER@
100101
px get viziers
101-
102-
# Check PEM stats
103102
px get pems
104-
```
103+
`}
104+
/>

gatsby-node.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ const availableClouds = [
3131
{
3232
name: 'New Relic Cloud',
3333
baseUrl: 'https://work.withpixie.ai',
34+
cloudAddr: 'withpixie.ai',
3435
},
3536
{
3637
name: 'Cosmic Cloud',
3738
baseUrl: 'https://work.getcosmic.ai',
39+
cloudAddr: 'getcosmic.ai',
3840
},
3941
];
4042

src/components/cloudLinkProvider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import * as React from 'react';
2121
const initialCloud = {
2222
name: 'New Relic Cloud',
2323
baseUrl: 'https://work.withpixe.ai',
24+
cloudAddr: 'withpixie.ai',
2425
};
2526

2627
export const CloudLinkContext = React.createContext(

src/components/mdxComponents/baseComponents.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import AnchorTag from './anchor';
3232
import CodeRenderer from './codeRenderer';
3333
import ListItem from './listItem';
3434
import HLink from './h-link';
35-
import CloudLink from './cloud-link';
35+
import { CloudLink, TemplatedCodeBlock } from './cloud-link';
3636
import PoiTooltip from '../poi-tooltip/poi-tooltip';
3737

3838
const getChildren = (props) => props.children;
@@ -92,4 +92,5 @@ export default {
9292
Alert,
9393
PoiTooltip,
9494
CloudLink: (props: any) => <CloudLink {...props} />,
95+
TemplatedCodeBlock: (props: any) => <TemplatedCodeBlock {...props} />,
9596
};

src/components/mdxComponents/cloud-link.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import * as React from 'react';
2020
import path from 'path';
2121
import { makeStyles } from '@material-ui/core/styles';
2222
import { CloudLinkContext } from '../cloudLinkProvider';
23+
import CodeRenderer from './codeRenderer';
2324

2425
const useStyles = makeStyles((theme: Theme) => ({
2526
link: {
@@ -36,11 +37,29 @@ const useStyles = makeStyles((theme: Theme) => ({
3637
}));
3738

3839
interface Props {
40+
code: string;
41+
}
42+
43+
// eslint-disable-next-line arrow-body-style
44+
export const TemplatedCodeBlock: React.FC<Props> = ({ code }) => {
45+
return (
46+
<CloudLinkContext.Consumer>
47+
{({ selectedCloud }) => (
48+
<CodeRenderer
49+
code={code.replaceAll('@PLACEHOLDER@', selectedCloud.cloudAddr)}
50+
language='bash'
51+
/>
52+
)}
53+
</CloudLinkContext.Consumer>
54+
);
55+
};
56+
57+
interface CloudLinkProps {
3958
children: string;
4059
url: string;
4160
}
4261

43-
const CloudLink: React.FC<Props> = ({ children, url }) => {
62+
export const CloudLink: React.FC<CloudLinkProps> = ({ children, url }) => {
4463
const classes = useStyles();
4564
return (
4665
<CloudLinkContext.Consumer>
@@ -52,4 +71,3 @@ const CloudLink: React.FC<Props> = ({ children, url }) => {
5271
</CloudLinkContext.Consumer>
5372
);
5473
};
55-
export default CloudLink;

0 commit comments

Comments
 (0)