Skip to content

Commit

Permalink
Merge branch 'master' into snyk-fix-ddfa5495b174d68eee966e1e7408f3c0
Browse files Browse the repository at this point in the history
  • Loading branch information
uma-kt authored Nov 4, 2024
2 parents ad64eb8 + dee8de0 commit 0f51c59
Show file tree
Hide file tree
Showing 225 changed files with 19,101 additions and 23,793 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.15-bookworm-slim as builder
FROM node:18.20.4-alpine as builder
WORKDIR /build
COPY . ./
COPY ./images/ ./static/images
Expand Down
33 changes: 30 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const { themes } = require('prism-react-renderer');
const data = require("./versioned_sidebars/version-1.3.0-sidebars.json");
import version from './versions.json'
import { getValidPaths } from './utils.js';


const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;

const validPaths = getValidPaths(data?.version3);
const latestVersion =version[0];

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand All @@ -18,6 +27,7 @@ const config = {
// If you aren't using GitHub pages, you don't need these.
organizationName: 'kubeslice', // Usually your GitHub org/user name.
projectName: 'docs', // Usually your repo name.
staticDirectories:['static', 'images'],

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
Expand Down Expand Up @@ -158,7 +168,24 @@ const config = {
{
id: 'GTM-N7K6NGB', // GTM Container ID
}
]
],
[
"@docusaurus/plugin-client-redirects",
{
fromExtensions: ["html", "htm"],
toExtensions: ["exe", "zip"],
redirects: validPaths?.map((path) => ({
from: `/latest/${path}`,
to: `/${latestVersion}/${path}`,
})),
createRedirects(existingPath) {
if (existingPath.includes("/latest")) {
return [existingPath.replace("/latest", `/${latestVersion}`)];
}
return undefined;
},
},
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
Expand Down
File renamed without changes
32,445 changes: 12,667 additions & 19,778 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "3.1.0",
"@docusaurus/plugin-content-blog": "^3.1.0",
"@docusaurus/plugin-google-gtag": "^3.1.0",
"@docusaurus/preset-classic": "3.1.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"@docusaurus/core": "3.4.0",
"@docusaurus/plugin-content-blog": "^3.4.0",
"@docusaurus/plugin-google-gtag": "^3.4.0",
"@docusaurus/preset-classic": "3.5.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.1.1",
"docusaurus-gtm-plugin": "^0.0.2",
"docusaurus-plugin-sass": "^0.2.5",
"prism-react-renderer": "^1.3.3",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.21",
"sass": "^1.54.0"
"@docusaurus/module-type-aliases": "^3.4.0",
"sass": "^1.69.5"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion prod.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22.3-bookworm-slim as builder
FROM node:18.2.0-alpine as builder
WORKDIR /build
COPY package.json ./
COPY package-lock.json ./
Expand Down
8 changes: 4 additions & 4 deletions src/theme/DocVersionBanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
useActivePlugin,
useDocVersionSuggestions,
} from '@docusaurus/plugin-content-docs/client';
import {ThemeClassNames} from '@docusaurus/theme-common';
import {
ThemeClassNames,
useDocsPreferredVersion,
useDocsVersion,
} from '@docusaurus/theme-common';
} from '@docusaurus/theme-common/internal';
function UnreleasedVersionLabel({siteTitle, versionMetadata}) {
return (
<Translate
Expand All @@ -37,7 +37,7 @@ function UnmaintainedVersionLabel({siteTitle, versionMetadata}) {
versionLabel: <b>{versionMetadata.label}</b>,
}}>
{
'This is documentation for {siteTitle} {versionLabel}, which is an older version.'
'This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.'
}
</Translate>
);
Expand Down Expand Up @@ -71,7 +71,7 @@ function LatestVersionSuggestionLabel({versionLabel, to, onClick}) {
),
}}>
{
'For the latest documentation, see the {latestVersionLink} ({versionLabel}).'
'For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).'
}
</Translate>
);
Expand Down
2 changes: 0 additions & 2 deletions src/theme/NotFound.d.ts

This file was deleted.

45 changes: 0 additions & 45 deletions src/theme/NotFound.js

This file was deleted.

36 changes: 36 additions & 0 deletions src/theme/NotFound/Content/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import clsx from 'clsx';
import Translate from '@docusaurus/Translate';
import Heading from '@theme/Heading';
export default function NotFoundContent({className}) {
return (
<main className={clsx('container margin-vert--xl', className)}>
<div className="row">
<div className="col col--6 col--offset-3">
<Heading as="h1" className="hero__title">
<Translate
id="theme.NotFound.title"
description="The title of the 404 page">
Page Not Found
</Translate>
</Heading>
<p>
<Translate
id="theme.NotFound.p1"
description="The first paragraph of the 404 page">
We could not find what you were looking for.
</Translate>
</p>
<p>
<Translate
id="theme.NotFound.p2"
description="The 2nd paragraph of the 404 page">
Please contact the owner of the site that linked you to the
original URL and let them know their link is broken.
</Translate>
</p>
</div>
</div>
</main>
);
}
31 changes: 31 additions & 0 deletions utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
function uniquePath(path) {
const segments = path?.split("/").filter(Boolean);
for (let i = 0; i < segments.length; i++) {
if (segments.length === 2 && segments[i] === segments[i + 1]) {
return segments[0] + "/";
}
}
return path;
}


export function getValidPaths(items) {
return items?.flatMap((item) => {
const paths = [];

if (item?.label) {
if (item.label !== "Overview") {
const formattedTitle = `category/${item?.label.toLowerCase().replace(/\s+/g, "-")}`;
paths.push(formattedTitle);
}
}

if (item?.items) {
paths.push(...getValidPaths(item?.items));
} else if (typeof item === "string") {
paths.push(uniquePath(item));
}

return paths;
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Before you begin, ensure the following prerequisites are met:
see [Installing the KubeSlice Controller](/versioned_docs/version-0.2.0/getting-started-with-cloud-clusters/installing-kubeslice/installing-the-kubeslice-controller.mdx).
- You have registered two or more worker clusters with the KubeSlice Controller. For more information,
see [Registering the Worker Cluster](/versioned_docs/version-0.2.0/getting-started-with-cloud-clusters/installing-kubeslice/registering-the-worker-cluster.mdx).
- You have installed Istio in the worker clusters to configure the external gateways. For more information,
see [Installing Istio](/versioned_docs/version-0.2.0/getting-started-with-cloud-clusters/installing-kubeslice/installing-the-kubeslice-controller.mdx#installing-istio).
- You have installed Istio in the worker clusters to configure the external gateways.

## Creating the Slice YAML File

Expand Down Expand Up @@ -255,9 +254,9 @@ The following information is required.

|Variable|Description|
|----|----|
|<cluster name\>|The name of the cluster.|
|<slice configuration\>|The name of the slice configuration file.|
|<project namespace\>|The project namespace on which you apply the slice configuration file.|
|`<cluster name>`|The name of the cluster.|
|`<slice configuration>`|The name of the slice configuration file.|
|`<project namespace>`|The project namespace on which you apply the slice configuration file.|

Perform these steps:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ The following information is required.

|Parameter|Description|
|----|----|
|<cluster name\>|The name of the cluster.|
|<values\>|The name of the values file.|
|`<cluster name>`|The name of the cluster.|
|`<values >`|The name of the values file.|

Use the following command to apply the YAML:
```
Expand Down Expand Up @@ -196,7 +196,7 @@ The following information is required.

|Parameter|Description|
|-----|-----|
|<project name\>|The given name of the project YAML file.|
|<project name />|The given name of the project YAML file.|

Use the following command to apply the YAML file:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ The following information is required.

|Values|Description|
|----|----|
|<cluster name\>|The name of the cluster.|
|<cluster registration\>|The name of the registration file.|
|<project namespace\>|The namespace of your project.|
|`<cluster name>`|The name of the cluster.|
|`<cluster registration>`|The name of the registration file.|
|`<project namespace>`|The namespace of your project.|

Perform these steps:

Expand Down Expand Up @@ -373,8 +373,8 @@ The following information is required to apply the YAML file.

|Parameter|Description|
|----|----|
|<cluster name\>|The name of the cluster.|
|<values\>|The file name with the values.|
|`<cluster name>`|The name of the cluster.|
|`<values>`|The file name with the values.|

Perform these steps:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Kubernetes Service (AKS) `kubeconfig`.

| **Variable** | **Description** |
|-----|-----|
| <resource group name\> | The name of the resource group the cluster belongs to.
<cluster name\> | The name of the cluster you would like to get credentials for.|
| `<resource group name>` | The name of the resource group the cluster belongs to.
`<cluster name>` | The name of the cluster you would like to get credentials for.|

The following command retrieves your AKS cluster `kubeconfig` and add it to your default `kubeconfig` path. Complete this step for each
AKS cluster that you want to work with.
Expand All @@ -43,8 +43,8 @@ Service (EKS) `kubeconfig`.

| **Variable** | **Description** |
|-----|----|
|<cluster name\> | The name of the cluster you want to get credentials for.|
| <cluster region\> | The AWS region the cluster belongs to.|
|`<cluster name>` | The name of the cluster you want to get credentials for.|
| `<cluster region>` | The AWS region the cluster belongs to.|

The following command retrieves your EKS cluster `kubeconfig` and adds
it to your default `kubeconfig` path. Complete this step for each EKS
Expand All @@ -62,9 +62,9 @@ Engine (GKE) `kubeconfig`.

| **Variable** | **Description** |
|-----|----|
|<cluster name\> | The name of the cluster you want to get credentials for.|
| <region\> | The region the cluster belongs to.|
| <project id\> | The project ID that the cluster belongs to.|
|`<cluster name>` | The name of the cluster you want to get credentials for.|
| `<region>` | The region the cluster belongs to.|
| `<project id>` | The project ID that the cluster belongs to.|


The following command retrieves your GKE cluster `kubeconfig` and adds
Expand Down Expand Up @@ -116,10 +116,10 @@ The following information is required to label the GKE cluster nodepools.

|**Variable** | **Description** |
|-----|----|
|<nodepool name\>| The name of the nodepool being labeled.|
|<cluster name\> | The name of the cluster the nodepool being labeled belongs to.|
| <region\> | The Compute Engine region for the cluster the nodepool belongs to.|
| <zone\> | The Compute Engine zone for the cluster the nodepool belongs to.|
|`<nodepool name>`| The name of the nodepool being labeled.|
|`<cluster name>` | The name of the cluster the nodepool being labeled belongs to.|
| `<region>` | The Compute Engine region for the cluster the nodepool belongs to.|
| `<zone>` | The Compute Engine zone for the cluster the nodepool belongs to.|

The following command labels the GKE cluster nodepool:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ automatically on all the clusters of the slice.

| Variables | Description |
|-------------------------|---------------------------------------------------------
| <cluster name\> | The name of the cluster the application is deployed on.|
|<serviceexport name\> | The name of the service export that you want to delete.|
| <namespace\> | The namespace the application is deployed on.|
| `<cluster name>` | The name of the cluster the application is deployed on.|
|`<serviceexport name>` | The name of the service export that you want to delete.|
| `<namespace>` | The namespace the application is deployed on.|

Switch the contexts to the cluster you deployed the application on:

Expand Down
Loading

0 comments on commit 0f51c59

Please sign in to comment.