Skip to content

Commit 35ef9d2

Browse files
committed
docs: installation using the helm chart
1 parent 3cc6a88 commit 35ef9d2

6 files changed

Lines changed: 107 additions & 23 deletions

File tree

web/docs/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Both checks are required before proceeding with the installation.
5757
import { InstallationSnippet } from '@site/src/components/Installation';
5858

5959
Install the plugin using `kubectl` by applying the manifest for the latest
60-
release:
60+
release or using the Helm chart:
6161

6262
<InstallationSnippet />
6363

web/docs/troubleshooting.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,14 +485,10 @@ If problems persist:
485485

486486
### Plugin Limitations
487487

488-
1. **Installation method**: Currently only supports manifest and Kustomize
489-
installation ([#351](https://github.com/cloudnative-pg/plugin-barman-cloud/issues/351) -
490-
Helm chart requested)
491-
492-
2. **Sidecar resource sharing**: The plugin sidecar container shares pod
488+
1. **Sidecar resource sharing**: The plugin sidecar container shares pod
493489
resources with PostgreSQL
494490

495-
3. **Plugin restart behavior**: Restarting the sidecar container requires
491+
2. **Plugin restart behavior**: Restarting the sidecar container requires
496492
restarting the entire PostgreSQL pod
497493

498494
## Recap of General Debugging Steps
@@ -588,4 +584,3 @@ kubectl get secret -n <namespace> <secret-name> -o jsonpath='{.data}' | jq 'keys
588584
* **"NoSuchBucket"** — Verify the bucket exists and the endpoint URL is correct.
589585
* **"Connection timeout"** — Check network connectivity and firewall rules.
590586
* **"SSL certificate problem"** — For self-signed certificates, verify the CA bundle configuration.
591-
Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
import {ReactElement} from 'react';
22
import CodeBlock from '@theme/CodeBlock';
33
import {useCurrentVersion} from '@site/src/hooks/versions';
4+
import {MultiLangCodeBlock} from '@site/src/components/MultiLangCodeBlock';
45

56
// InstallationSnippet is the kubectl incantation to install the lastest
67
// available version of the Barman Cloud Plugin.
78
export function InstallationSnippet(): ReactElement<null> {
89
const latest = useCurrentVersion('latestReleased');
9-
return (
10-
<CodeBlock language="sh">
11-
{`kubectl apply -f \\
12-
https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v${latest}/manifest.yaml`}
13-
</CodeBlock>
14-
);
15-
}
1610

11+
const snippets = [
12+
{
13+
label: 'kubectl',
14+
language: 'sh',
15+
code: `kubectl apply -f \\
16+
https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v${latest}/manifest.yaml`,
17+
},
18+
{
19+
label: 'Helm',
20+
language: 'sh',
21+
code: `helm repo add cnpg https://cloudnative-pg.github.io/charts
22+
helm repo update
23+
helm upgrade \\
24+
--install \\
25+
--namespace cnpg-system \\
26+
plugin-barman-cloud cnpg/plugin-barman-cloud`,
27+
},
28+
];
29+
30+
return <MultiLangCodeBlock snippets={snippets} />;
31+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import React, {ReactElement, useState} from 'react';
2+
import CodeBlock from '@theme/CodeBlock';
3+
4+
export type Snippet = {
5+
label: string; // visible tab label (e.g. "Shell", "Helm", "Go")
6+
language: string; // language prop for CodeBlock (e.g. "sh", "yaml", "go")
7+
code: string; // the snippet to display
8+
};
9+
10+
type Props = {
11+
snippets: Snippet[];
12+
defaultIndex?: number;
13+
className?: string;
14+
};
15+
16+
export function MultiLangCodeBlock({snippets, defaultIndex = 0, className}: Props): ReactElement | null {
17+
const safeDefault = Math.max(0, Math.min(defaultIndex, snippets.length - 1));
18+
const [active, setActive] = useState<number>(snippets.length > 0 ? safeDefault : -1);
19+
20+
if (snippets.length === 0) return null;
21+
22+
const tabStyle: React.CSSProperties = {
23+
padding: '0.3rem 0.5rem',
24+
cursor: 'pointer',
25+
border: '0',
26+
borderRadius: 'var(--ifm-code-border-radius)',
27+
margin: '0 0 0 0',
28+
fontSize: '0.8125rem',
29+
color: 'inherit',
30+
};
31+
32+
const activeTabStyle: React.CSSProperties = {
33+
...tabStyle,
34+
fontWeight: 700,
35+
};
36+
37+
const tabsContainerStyle: React.CSSProperties = {
38+
display: 'flex',
39+
alignItems: 'flex-end',
40+
justifyContent: 'flex-end',
41+
gap: '0.25rem',
42+
margin: '0 0 -0.5rem',
43+
padding: '0.5rem 0.5rem 1rem',
44+
flexWrap: 'wrap',
45+
};
46+
47+
const wrapperStyle: React.CSSProperties = {
48+
overflow: 'hidden',
49+
padding: '0',
50+
};
51+
52+
return (
53+
<div className={className} style={wrapperStyle}>
54+
<div role="tablist" aria-label="Code snippets" style={tabsContainerStyle}>
55+
{snippets.map((ex, idx) => (
56+
<button
57+
key={ex.label + idx}
58+
role="tab"
59+
aria-selected={active === idx}
60+
aria-controls={`code-panel-${idx}`}
61+
id={`code-tab-${idx}`}
62+
onClick={() => setActive(idx)}
63+
style={active === idx ? activeTabStyle : tabStyle}
64+
>
65+
{ex.label}
66+
</button>
67+
))}
68+
</div>
69+
70+
<div role="tabpanel" id={`code-panel-${active}`} aria-labelledby={`code-tab-${active}`}>
71+
<CodeBlock language={snippets[active].language}>
72+
{snippets[active].code}
73+
</CodeBlock>
74+
</div>
75+
</div>
76+
);
77+
}
78+
79+
export default MultiLangCodeBlock;

web/versioned_docs/version-0.13.0/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Both checks are required before proceeding with the installation.
5757
import { InstallationSnippet } from '@site/src/components/Installation';
5858

5959
Install the plugin using `kubectl` by applying the manifest for the latest
60-
release:
60+
release or using the Helm chart:
6161

6262
<InstallationSnippet />
6363

web/versioned_docs/version-0.13.0/troubleshooting.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,14 +485,10 @@ If problems persist:
485485

486486
### Plugin Limitations
487487

488-
1. **Installation method**: Currently only supports manifest and Kustomize
489-
installation ([#351](https://github.com/cloudnative-pg/plugin-barman-cloud/issues/351) -
490-
Helm chart requested)
491-
492-
2. **Sidecar resource sharing**: The plugin sidecar container shares pod
488+
1. **Sidecar resource sharing**: The plugin sidecar container shares pod
493489
resources with PostgreSQL
494490

495-
3. **Plugin restart behavior**: Restarting the sidecar container requires
491+
2. **Plugin restart behavior**: Restarting the sidecar container requires
496492
restarting the entire PostgreSQL pod
497493

498494
## Recap of General Debugging Steps
@@ -588,4 +584,3 @@ kubectl get secret -n <namespace> <secret-name> -o jsonpath='{.data}' | jq 'keys
588584
* **"NoSuchBucket"** — Verify the bucket exists and the endpoint URL is correct.
589585
* **"Connection timeout"** — Check network connectivity and firewall rules.
590586
* **"SSL certificate problem"** — For self-signed certificates, verify the CA bundle configuration.
591-

0 commit comments

Comments
 (0)