Skip to content

Commit

Permalink
fix: 2.1 docs using v.next content for MDX imports (2/3 fix for #441)
Browse files Browse the repository at this point in the history
  • Loading branch information
fharper committed Jul 26, 2023
1 parent ef8ce92 commit 3758817
Show file tree
Hide file tree
Showing 46 changed files with 221 additions and 102 deletions.
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/advanced/certificates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Certificates
---

import * as config from "@site/docs/constants.js"
import * as config from "../../constants.js"

<div
style={{
Expand Down
9 changes: 4 additions & 5 deletions versioned_docs/version-2.1/aws/advanced/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ image: "https://docs.kubefirst.io/img/logo.svg"

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import styles from "@site/docs/stylesheets/tabs.module.css";
import ReactDom from 'react-dom'
import * as config from "@site/docs/constants.js"
import GitHubInstall from '@site/docs/aws/partials/github/_install.mdx'
import GitLabInstall from '@site/docs/aws/partials/gitlab/_install.mdx'
import styles from "../../stylesheets/tabs.module.css";
import * as config from "../../constants.js"
import GitHubInstall from '../partials/github/_install.mdx'
import GitLabInstall from '../partials/gitlab/_install.mdx'

<div
style={{
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/advanced/security.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Security
---

import * as config from "@site/docs/constants.js"
import * as config from "../../constants.js"

<div
style={{
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/credits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ description: how to destroy your kubefirst platform
image: "https://docs.kubefirst.io/img/logo.svg"
---

import Credits from "@site/docs/common/credits.mdx"
import Credits from "../common/credits.mdx"

<Credits />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/deprovision.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ description: how to destroy your kubefirst platform
image: "https://docs.kubefirst.io/img/logo.svg"
---

import Deprovision from '@site/docs/common/deprovision.mdx'
import Deprovision from '../common/deprovision.mdx'

<Deprovision />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/explore/argocd.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Argo CD
sidebar_position: 1
---

import ExploreArgocd from "@site/docs/common/argocd.mdx"
import ExploreArgocd from "../../common/argocd.mdx"

<ExploreArgocd />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/explore/gitops.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ sidebar_position: 2
---


import ExploreGitOps from "@site/docs/common/gitops.mdx"
import ExploreGitOps from "../../common/gitops.mdx"

<ExploreGitOps />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/explore/metaphor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Metaphor
sidebar_position: 3
---

import ExploreMetaphor from "@site/docs/common/metaphor.mdx"
import ExploreMetaphor from "../../common/metaphor.mdx"

<ExploreMetaphor />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/explore/platform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Telemetry
sidebar_position: 6
---

import ExploreTelemetry from "@site/docs/common/telemetry.mdx"
import ExploreTelemetry from "../../common/telemetry.mdx"

<ExploreTelemetry />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/explore/terraform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Terraform & Atlantis
sidebar_position: 5
---

import ExploreTerraform from "@site/docs/common/terraform.mdx"
import ExploreTerraform from "../../common/terraform.mdx"

<ExploreTerraform />
6 changes: 3 additions & 3 deletions versioned_docs/version-2.1/aws/explore/user-creation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ sidebar_position: 5
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import styles from "@site/docs/stylesheets/tabs.module.css";
import styles from "../../stylesheets/tabs.module.css";

import GitHubUserCreation from '@site/docs/civo/partials/github/_user-creation.mdx'
import GitLabUserCreation from '@site/docs/civo/partials/gitlab/_user-creation.mdx'
import GitHubUserCreation from '../partials/github/_user-creation.mdx'
import GitLabUserCreation from '../partials/gitlab/_user-creation.mdx'

<Tabs groupId="git_provider" defaultValue="github" queryString>
<TabItem value="github" label="GitHub" attributes={{className: styles.github}}>
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/explore/vault.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Vault
sidebar_position: 4
---

import ExploreVault from "@site/docs/common/vault.mdx"
import ExploreVault from "../../common/vault.mdx"

<ExploreVault />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/aws/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ description: frequently asked quesitons about the platform
image: "https://docs.kubefirst.io/img/logo.svg"
---

import FAQ from "@site/docs/common/faq.mdx"
import FAQ from "../common/faq.mdx"

<FAQ />
8 changes: 4 additions & 4 deletions versioned_docs/version-2.1/aws/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ image: "https://docs.kubefirst.io/img/logo.svg"

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import styles from "@site/docs/stylesheets/tabs.module.css";
import styles from "../stylesheets/tabs.module.css";
import ReactDom from 'react-dom'
import * as config from "@site/docs/constants.js"
import GitHubOverview from '@site/docs/aws/partials/github/_overview.mdx'
import GitLabOverview from '@site/docs/aws/partials/gitlab/_overview.mdx'
import * as config from "../constants.js"
import GitHubOverview from '../aws/partials/github/_overview.mdx'
import GitLabOverview from '../aws/partials/gitlab/_overview.mdx'

<div
style={{
Expand Down
62 changes: 62 additions & 0 deletions versioned_docs/version-2.1/aws/partials/github/_user-creation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
## Platform User Onboarding

In this tutorial we will show how to add users to your platform through [Atlantis](https://www.runatlantis.io/), which will allow a preview of how changes made will be expressed through Terraform before branches are merged into your repository.

Navigate to the `gitops` repository in your GitHub org, clone the contents, and create a new branch:

```shell
cd gitops
git checkout -b new-user
```

The folder `aws-github/terraform/users/admins` contains two separate files that represent admin users: `admin-one.tf` (commented-out), and the kbot user in the `kbot.tf` file. Here's the module from `admin-one.tf`:

```terraform
module "admin_one" {
source = "./modules/user/github"
acl_policies = ["admin"]
email = "[email protected]"
first_name = "Admin"
github_username = "admin-one-github-username"
last_name = "One"
team_id = data.github_team.admins.id
username = "aone"
user_disabled = false
userpass_accessor = data.vault_auth_backend.userpass.accessor
}
```

Uncomment and edit this code to replace the values for the `email`, `first_name`, `github_username`, `last_name`, and `username` before pushing to your branch.

Note: If you are doing using this walkthrough simply to test Atlantis, you do not need to update these fields to be accurate.

```shell
git add .
git commit -m feat: add new user
git push --set-upstream origin new-user
```

Create a pull request. This will kick off the Atlantis workflow. Within a minute or so of submitting the pull request, a comment will appear on the pull request that shows the Terraform plan with the changes it will be making to your infrastructure.

![Atlantis Plan Comment Example](../../../img/common/github/atlantis-comments.png)

To apply these changes, you or someone in the organization can submit a comment on that pull request with the following comment text:

`atlantis apply`

Doing so will instruct Atlantis to apply the plan. It will report back with the results of the apply within a minute or so.

NOTE: Atlantis merges your pull request automatically once an apply is successfully executed. Don't merge Terraform pull requests yourself.

Atlantis will always run plans automatically for you when a pull request is opened that changes files mapped in `atlantis.yaml`.

Any new users you have created through this process will have their temporary initial passwords stored in your Vault cluster. You can access Vault using the root login credentials provided to you during your kubefirst installation. Only the root Vault token can access these secrets. You will find your users' initial passwords in the Vault secret store `/secrets/users/<username>`.

![vault token login](../../../img/kubefirst/local/vault-token-login.png)

Once you've provided them their initial password, they can update their own password throughout the platform by updating their user password entity in Vault. Anyone can change their own password, and Admins can reset anyone's password. These rules, just like everything else on kubefirst, can be configured in your new `gitops` repository.

![default user creation](../../../img/kubefirst/local/default-user-creation.png)

The admins and developers that you add through IaC will automatically propagate to all tools due to the Vault OIDC provider that's preconfigured throughout the kubefirst platform tools.
63 changes: 63 additions & 0 deletions versioned_docs/version-2.1/aws/partials/gitlab/_user-creation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## Platform User Onboarding

In this tutorial we will show how to add users to your platform through [Atlantis](https://www.runatlantis.io/), which will allow a preview of how changes made will be expressed through Terraform before branches are merged into your repository.

Navigate to the `gitops` repository in your GitLab group, clone the contents, and create a new branch:

```shell
cd gitops
git checkout -b new-user
```

The folder `aws-gitlab/terraform/users/admins` contains two separate files that represent admin users: `admin-one.tf` (commented-out), and the kbot user in the `kbot.tf` file. Here's the module from `admin-one.tf`:

```terraform
module "admin_one" {
source = "../modules/user"
acl_policies = ["admin"]
email = "[email protected]"
first_name = "Admin"
fullname = "Admin One"
group_id = data.vault_identity_group.admins.group_id
gitlab_username = "your-admins-gitlab-username"
last_name = "One"
username = "aone"
user_disabled = false
userpass_accessor = data.vault_auth_backend.userpass.accessor
}
```

Uncomment and edit this code to replace the values for the `email`, `first_name`, `gitlab_username`, `last_name`, and `username` before pushing to your branch.

Note: If you are doing using this walkthrough simply to test Atlantis, you do not need to update these fields to be accurate.

```shell
git add .
git commit -m feat: add new user
git push --set-upstream origin new-user
```

Create a merge request. This will kick off the Atlantis workflow. Within a minute or so of submitting the merge request, a comment will appear on the merge request that shows the Terraform plan with the changes it will be making to your infrastructure.

![Atlantis Plan Comment Example](../../../img/common/gitlab/atlantis-comments.png)

To apply these changes, you or someone in the organization can submit a comment on that merge request with the following comment text:

`atlantis apply`

Doing so will instruct Atlantis to apply the plan. It will report back with the results of the apply within a minute or so.

NOTE: Atlantis merges your merge request automatically once an apply is successfully executed. Don't merge Terraform merge requests yourself.

Atlantis will always run plans automatically for you when a merge request is opened that changes files mapped in `atlantis.yaml`.

Any new users you have created through this process will have their temporary initial passwords stored in your Vault cluster. You can access Vault using the root login credentials provided to you during your kubefirst installation. Only the root Vault token can access these secrets. You will find your users' initial passwords in the Vault secret store `/secrets/users/<username>`.

![vault token login](../../../img/kubefirst/local/vault-token-login.png)

Once you've provided them their initial password, they can update their own password throughout the platform by updating their user password entity in Vault. Anyone can change their own password, and Admins can reset anyone's password. These rules, just like everything else on kubefirst, can be configured in your new `gitops` repository.

![default user creation](../../../img/kubefirst/local/default-user-creation.png)

The admins and developers that you add through IaC will automatically propagate to all tools due to the Vault OIDC provider that's preconfigured throughout the kubefirst platform tools.
24 changes: 12 additions & 12 deletions versioned_docs/version-2.1/aws/quick-start/install/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ image: "https://docs.kubefirst.io/img/logo.svg"
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

import GitHubClusterCreateCmd from "@site/docs/aws/partials/github/_cluster-create.mdx";
import GitLabClusterCreateCmd from "@site/docs/aws/partials/gitlab/_cluster-create.mdx";

import CommonCloudPrerequisites from "@site/docs/aws/partials/common/_prerequisites.mdx";
import CommonClusterConnectivity from "@site/docs/aws/partials/common/_cluster-connectivity.mdx";
import CommonGitHubPrerequisites from "@site/docs/common/partials/github/_prerequisites.mdx";
import CommonGitLabPrerequisites from "@site/docs/common/partials/gitlab/_prerequisites.mdx";
import AWSRootCredentialsCmd from "@site/docs/aws/partials/common/_root-credentials-cmd.mdx";
import CommonTerminalOutput from "@site/docs/common/partials/common/_terminal-output.mdx";

import * as config from "@site/docs/constants.js"
import styles from "@site/docs/stylesheets/tabs.module.css";
import GitHubClusterCreateCmd from "../../partials/github/_cluster-create.mdx";
import GitLabClusterCreateCmd from "../../partials/gitlab/_cluster-create.mdx";

import CommonCloudPrerequisites from "../../partials/common/_prerequisites.mdx";
import CommonClusterConnectivity from "../../partials/common/_cluster-connectivity.mdx";
import CommonGitHubPrerequisites from "../../../common/partials/github/_prerequisites.mdx";
import CommonGitLabPrerequisites from "../../../common/partials/gitlab/_prerequisites.mdx";
import AWSRootCredentialsCmd from "../../partials/common/_root-credentials-cmd.mdx";
import CommonTerminalOutput from "../../../common/partials/common/_terminal-output.mdx";

import * as config from "../../../constants.js"
import styles from "../../../stylesheets/tabs.module.css";

export const TabLabel = ({ imgSrc, label }) => (
<div className="git-tab">
Expand Down
8 changes: 4 additions & 4 deletions versioned_docs/version-2.1/aws/quick-start/repositories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ image: "https://docs.kubefirst.io/img/logo.svg"

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import styles from "@site/docs/stylesheets/tabs.module.css";
import styles from "../../stylesheets/tabs.module.css";
import ReactDom from 'react-dom'
import * as config from "@site/docs/constants.js"
import GitHubRepositories from '@site/docs/aws/partials/github/_repositories.mdx'
import GitLabRepositories from '@site/docs/aws/partials/gitlab/_repositories.mdx'
import * as config from "../../constants.js"
import GitHubRepositories from '../partials/github/_repositories.mdx'
import GitLabRepositories from '../partials/gitlab/_repositories.mdx'

<div
style={{
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/civo/credits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ description: credit to all the awesome open source projects
image: "https://docs.kubefirst.io/img/logo.svg"
---

import CommonCredits from "@site/docs/common/credits.mdx"
import CommonCredits from "../common/credits.mdx"

<CommonCredits />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/civo/deprovision.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ keywords:
image: "https://docs.kubefirst.io/img/logo.svg"
---

import Deprovision from '@site/docs/common/deprovision.mdx'
import Deprovision from '../common/deprovision.mdx'

<Deprovision />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/civo/explore/argocd.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Argo CD
sidebar_position: 1
---

import ExploreArgocd from "@site/docs/common/argocd.mdx"
import ExploreArgocd from "../../common/argocd.mdx"

<ExploreArgocd />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/civo/explore/gitops.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ sidebar_position: 2
---


import ExploreGitOps from "@site/docs/common/gitops.mdx"
import ExploreGitOps from "../../common/gitops.mdx"

<ExploreGitOps />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/civo/explore/metaphor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Metaphor
sidebar_position: 3
---

import ExploreMetaphor from "@site/docs/common/metaphor.mdx"
import ExploreMetaphor from "../../common/metaphor.mdx"

<ExploreMetaphor />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/civo/explore/telemetry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Telemetry
sidebar_position: 7
---

import ExploreTelemetry from "@site/docs/common/telemetry.mdx"
import ExploreTelemetry from "../../common/telemetry.mdx"

<ExploreTelemetry />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/civo/explore/terraform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Terraform & Atlantis
sidebar_position: 4
---

import ExploreTerraform from "@site/docs/common/terraform.mdx"
import ExploreTerraform from "../../common/terraform.mdx"

<ExploreTerraform />
6 changes: 3 additions & 3 deletions versioned_docs/version-2.1/civo/explore/user-creation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ sidebar_position: 5

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import styles from "@site/docs/stylesheets/tabs.module.css";
import styles from "../../stylesheets/tabs.module.css";

import GitHubUserCreation from '@site/docs/civo/partials/github/_user-creation.mdx'
import GitLabUserCreation from '@site/docs/civo/partials/gitlab/_user-creation.mdx'
import GitHubUserCreation from '../partials/github/_user-creation.mdx'
import GitLabUserCreation from '../partials/gitlab/_user-creation.mdx'

<Tabs groupId="git_provider" defaultValue="github" queryString>
<TabItem
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/civo/explore/vault.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: Vault
sidebar_position: 6
---

import ExploreVault from "@site/docs/common/vault.mdx"
import ExploreVault from "../../common/vault.mdx"

<ExploreVault />
2 changes: 1 addition & 1 deletion versioned_docs/version-2.1/civo/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ description: frequently asked quesitons about the kubefirst platform
image: "https://docs.kubefirst.io/img/logo.svg"
---

import FAQ from "@site/docs/common/faq.mdx"
import FAQ from "../common/faq.mdx"

<FAQ />
Loading

0 comments on commit 3758817

Please sign in to comment.