Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from 'react';

import Admonition from '@theme/Admonition';
import CodeBlock from '@theme/CodeBlock';
import Link from '@docusaurus/Link';

import { baseUrl } from '../../variables';

export default function EnvironmentFile(props) {
return (
<>
<p>
{props.install === 'container' ? (
<span>
Use the following guidelines and sample file to define the environment variables for starting Calico on the host.
For more help, see the <Link href={`${baseUrl}/reference/component-resources/node/configuration`}>{props.nodecontainer} configuration reference</Link>
</span>
) : (
<span>
Use the following guidelines and sample file to define the environment variables for starting Calico on the host.
</span>
)}
</p>
<p>For the Kubernetes datastore set the following:</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Configuration guidance</th>
</tr>
</thead>
<tbody>
<tr>
<td>KUBECONFIG</td>
<td>Path to kubeconfig file to access the Kubernetes API Server</td>
</tr>
</tbody>
</table>
{props.install === 'container' && (
<Admonition type='note'>
If using certificates and keys, you will need to volume mount them into the container at the location
specified by the paths mentioned above.
</Admonition>
)}
<p>
Sample <code>EnvironmentFile</code> - save to <code>/etc/calico/calico.env</code>
</p>
<CodeBlock language='bash'>
{`DATASTORE_TYPE=kubernetes
CALICO_NODENAME=""
NO_DEFAULT_POOLS="true"
CALICO_IP=""
CALICO_IP6=""
CALICO_AS=""
CALICO_NETWORKING_BACKEND=bird`}
</CodeBlock>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React from 'react';
import sanitizeHtml from 'sanitize-html';
import styles from './styles.module.css';

const getSanitizedData = ({ fieldData }) => ({
sanitizedDescription: { __html: sanitizeHtml(fieldData.DescriptionHTML) },
sanitizedSchema: { __html: sanitizeHtml(fieldData.StringSchemaHTML) },
});

const TableConfig = ({ fieldData }) => {
const { sanitizedDescription, sanitizedSchema } = getSanitizedData({ fieldData });

return (
<table className={styles.felixTable}>
<thead>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Key</td>
<td>
<code>{fieldData.NameConfigFile || 'No Default Value'}</code>
</td>
</tr>
<tr>
<td>Description</td>
<td dangerouslySetInnerHTML={sanitizedDescription} />
</tr>
<tr>
<td>Schema</td>
<td dangerouslySetInnerHTML={sanitizedSchema} />
</tr>
<tr>
<td>Default</td>
<td>
{fieldData.StringDefault === '' ? (
'none'
) : fieldData.GoType === '*v1.Duration' ? (
<>
<code>{fieldData.StringDefault}</code> ({fieldData.ParsedDefault})
</>
) : (
<code>{fieldData.StringDefault}</code>
)}
</td>
</tr>
</tbody>
</table>
);
};

export default TableConfig;
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React from 'react';
import sanitizeHtml from 'sanitize-html';
import styles from './styles.module.css';

const getSanitizedData = ({ fieldData }) => ({
sanitizedDescription: { __html: sanitizeHtml(fieldData.DescriptionHTML) },
sanitizedSchema: { __html: sanitizeHtml(fieldData.StringSchemaHTML) },
});

const TableEnv = ({ fieldData }) => {
const { sanitizedDescription, sanitizedSchema } = getSanitizedData({ fieldData });

return (
<table className={styles.felixTable}>
<thead>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Key</td>
<td>
<code>{fieldData.NameEnvVar.toUpperCase() || 'No Default Value'}</code>
</td>
</tr>
<tr>
<td>Description</td>
<td dangerouslySetInnerHTML={sanitizedDescription} />
</tr>
<tr>
<td>Schema</td>
<td dangerouslySetInnerHTML={sanitizedSchema} />
</tr>
<tr>
<td>Default</td>
<td>
{fieldData.StringDefault === '' ? (
'none'
) : fieldData.GoType === '*v1.Duration' ? (
<>
<code>{fieldData.StringDefault}</code> ({fieldData.ParsedDefault})
</>
) : (
<code>{fieldData.StringDefault}</code>
)}
</td>
</tr>
</tbody>
</table>
);
};

export default TableEnv;
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';
import sanitizeHtml from 'sanitize-html';
import styles from './styles.module.css';

const getSanitizedData = ({ fieldData }) => ({
sanitizedNAMEYAML: { __html: sanitizeHtml(fieldData.NameYAML) },
sanitizedDescription: { __html: sanitizeHtml(fieldData.DescriptionHTML) },
sanitizedSchema: { __html: sanitizeHtml(fieldData.YAMLSchemaHTML) },
});

const TableResource = ({ fieldData }) => {
const { sanitizedNAMEYAML, sanitizedDescription, sanitizedSchema } = getSanitizedData({ fieldData });

return (
<table className={styles.felixTable}>
<thead>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Key</td>
<td>
<code dangerouslySetInnerHTML={sanitizedNAMEYAML} />
</td>
</tr>
<tr>
<td>Description</td>
<td dangerouslySetInnerHTML={sanitizedDescription} />
</tr>
<tr>
<td>Schema</td>
<td dangerouslySetInnerHTML={sanitizedSchema} />
</tr>
<tr>
<td>Default</td>
<td>{fieldData.YAMLDefault === '' ? 'none' : <code>{fieldData.YAMLDefault}</code>}</td>
</tr>
</tbody>
</table>
);
};

export default TableResource;
Loading
Loading