Skip to content

Commit

Permalink
docs: add Google Cloud documentation (#327)
Browse files Browse the repository at this point in the history
Co-authored-by: Frédéric Harper <[email protected]>
  • Loading branch information
Jared Edwards and fharper authored Jul 19, 2023
1 parent cf0dfc4 commit efbed83
Show file tree
Hide file tree
Showing 53 changed files with 950 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ In MDX v1, JSX and Markdown don't interoperate well: it has been fixed in MDX v2

##### Admonitions

You can also use special Docusaurus Markdown syntax called admonitions, which let you display beautiful notes, informations, warnings, and others.
You can also use special Docusaurus Markdown syntax called admonitions, which let you display beautiful notes, information, warnings, and others.

```markdown
:::note
Expand Down
2 changes: 2 additions & 0 deletions docs/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export const GITLAB_LOGO_URL =
'https://assets.kubefirst.com/console/gitlab.svg';
export const VULTR_LOGO_URL =
'https://cf-assets.www.cloudflare.com/slt3lc6tev37/1ATBPX4YOBbCRkybT4zS2e/f4f5f0900b57c61e65960efb3d11c64f/Vultr_logo_high_res.png';
export const GCP_LOGO_URL =
'https://upload.wikimedia.org/wikipedia/commons/5/51/Google_Cloud_logo.svg';
11 changes: 11 additions & 0 deletions docs/gcp/credits.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_title: true
sidebar_label: Credits
# custom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md
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"

<CommonCredits />
14 changes: 14 additions & 0 deletions docs/gcp/deprovision.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
hide_title: true
display_sidebar: gcp
sidebar_label: Deprovision
# custom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md
description: how to deprovision your kubefirst platform
keywords:
- aws
image: "https://docs.kubefirst.io/img/logo.svg"
---

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

<Deprovision />
8 changes: 8 additions & 0 deletions docs/gcp/explore/argocd.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Argo CD
sidebar_position: 1
---

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

<ExploreArgocd />
9 changes: 9 additions & 0 deletions docs/gcp/explore/gitops.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: GitOps
sidebar_position: 2
---


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

<ExploreGitOps />
8 changes: 8 additions & 0 deletions docs/gcp/explore/metaphor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Metaphor
sidebar_position: 3
---

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

<ExploreMetaphor />
8 changes: 8 additions & 0 deletions docs/gcp/explore/telemetry.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Telemetry
sidebar_position: 7
---

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

<ExploreTelemetry />
8 changes: 8 additions & 0 deletions docs/gcp/explore/terraform.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Terraform & Atlantis
sidebar_position: 4
---

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

<ExploreTerraform />
37 changes: 37 additions & 0 deletions docs/gcp/explore/user-creation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: User Creation
sidebar_position: 5
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import styles from "@site/docs/stylesheets/tabs.module.css";
import GitHubUserCreation from '@site/docs/gcp/partials/github/_user-creation.mdx'
import GitLabUserCreation from '@site/docs/gcp/partials/gitlab/_user-creation.mdx'

<Tabs groupId="git_provider" defaultValue="github" queryString>
<TabItem
attributes={{className: styles.github}}
value="github"
label={
<div className="git-tab">
<img src="https://assets.kubefirst.com/console/github.svg" />
<span>GitHub</span>
</div>
}
>
<GitHubUserCreation />
</TabItem>
<TabItem
value="gitlab"
attributes={{className: styles.gitlab}}
label={
<div className="git-tab">
<img src="https://assets.kubefirst.com/console/gitlab.svg" />
<span>GitLab</span>
</div>
}
>
<GitLabUserCreation />
</TabItem>
</Tabs>
8 changes: 8 additions & 0 deletions docs/gcp/explore/vault.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Vault
sidebar_position: 6
---

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

<ExploreVault />
11 changes: 11 additions & 0 deletions docs/gcp/faq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_title: true
sidebar_label: FAQ
# custom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md
description: frequently asked quesitons about the kubefirst platform
image: "https://docs.kubefirst.io/img/logo.svg"
---

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

<FAQ />
62 changes: 62 additions & 0 deletions docs/gcp/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
hide_title: true
sidebar_label: Overview
sidebar_position: 1
# custom_edit_url: https://github.com/facebook/docusaurus/edit/main/docs/api-doc-markdown.md
description: an overview of kubefirst on a Google Cloud kubernetes cluster
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 GitHubOverview from '@site/docs/gcp/partials/github/_overview.mdx'
import GitLabOverview from '@site/docs/gcp/partials/gitlab/_overview.mdx'
import CloudBanner from '@site/src/components/CloudBanner/CloudBanner.jsx'
import CommonProvisionProcess from "@site/docs/common/partials/common/_provision-process.mdx";

<CloudBanner cloudImgUrl={config.gcp_LOGO_URL} />

# Overview

:::caution

Google Cloud is in beta. Use at your own risks.

:::

The Google Cloud provisioning process will:
<CommonProvisionProcess firstitem="Create a Kubernetes cluster in Google Cloud."/>

![kubefirst Google Cloud with GitLab Cluster Diagram](../img/gcp/gitlab/installation-diagram-light.png#light-mode)![kubefirst Google Cloud with GitLab Cluster Diagram](../img/gcp/gitlab/installation-diagram-dark.png#dark-mode)

# Applications

<Tabs groupId="git_provider" defaultValue="github" queryString>
<TabItem
attributes={{className: styles.github}}
value="github"
label={
<div className="git-tab">
<img src="https://assets.kubefirst.com/console/github.svg" />
<span>GitHub</span>
</div>
}
>
<GitHubOverview />
</TabItem>
<TabItem
value="gitlab"
attributes={{className: styles.gitlab}}
label={
<div className="git-tab">
<img src="https://assets.kubefirst.com/console/gitlab.svg" />
<span>GitLab</span>
</div>
}
>
<GitLabOverview />
</TabItem>
</Tabs>
13 changes: 13 additions & 0 deletions docs/gcp/partials/common/_cluster-connectivity.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Connecting to Kubernetes

To connect to your new Kubernetes cluster, run

```bash
export KUBECONFIG=~/.k1/kubeconfig
```

To view all cluster pods, run

```bash
kubectl get pods -A
```
3 changes: 3 additions & 0 deletions docs/gcp/partials/common/_installed-applications.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Installed Applications

To see what is installed by kubefirst, check the [overview page](../../overview.mdx).
13 changes: 13 additions & 0 deletions docs/gcp/partials/common/_prerequisites.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Prerequisites

### Local Prerequisites

[Install](../../overview.mdx) the kubefirst CLI.

### Google Cloud Prerequisites

For kubefirst to be able to provision your Google Cloud resources:

- A [Google Cloud account](https://cloud.google.com) in which you are an account owner.
- A publicly routable [DNS](https://cloud.google.com/dns/docs/overview).
- A [Google Cloud token](https://console.cloud.google.com/apis/credentials).
12 changes: 12 additions & 0 deletions docs/gcp/partials/common/_root-credentials-cmd.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Root credentials

To obtain your 3 initial passwords, run

```bash
kubefirst beta gcp root-credentials
```

![terminal handoff](../../../img/common/kubefirst/root-credentials.png)

:::note the `kubefirst beta gcp root-credentials` command was introduced in 2.0.1
:::
22 changes: 22 additions & 0 deletions docs/gcp/partials/github/_cluster-create.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Create your new kubefirst cluster

Adjust the following command with your GitHub and Google Cloud tokens in addition to the appropriate values for your new platform.

```shell
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxx
export gcp_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

kubefirst beta gcp create \
--alerts-email [email protected] \
--github-org your-github-org \
--domain-name your-domain.io \
--cluster-name kubefirst
```

The kubefirst CLI will produce a directory of utilities, a state file, and some staged platform content that can now be found in the `~/.kubefirst` and `~/.k1` folders on your local machine.

After the ~10 minute installation, your browser will launch a new tab to the [kubefirst Console](https://github.com/kubefirst/console), which will help you navigate your new suite of tools running in your new Google Cloud cluster.

If your deployment is not successful, errors and troubleshooting information will be stored in a local log file specified during the installation run.

![terminal handoff](../../../img/gcp/gitlab/handoff-screen.png)
76 changes: 76 additions & 0 deletions docs/gcp/partials/github/_install.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Google Cloud Platform Installation

kubefirst generates your cloud native platform from a `helm install` or a `kubefirst` CLI execution.

## Prerequisites

### GitHub Prerequisites

- A GitHub [organisation](https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/creating-a-new-organization-from-scratch).
- A new GitHub [account](https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account) for your `kbot` automation user.
- A GitHub [personal access token](../../../common/git-auth.mdx) for your `kbot` account.

### Google Cloud Prerequisites

For kubefirst to be able to provision your Google Cloud resources:

- A [Google Cloud account](https://cloud.google.com) in which you are an account owner.
- A publicly routable [DNS](https://cloud.google.com/dns/docs/overview).
- Generate [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials#GAC) (ADC) (you could use the [Google Cloud CLI](https://cloud.google.com/sdk/gcloud) with the command `gcloud auth application-default login`)

## Create your new kubefirst cluster

Adjust the following command with your GitHub and Google Cloud credentials file path (it's set to the default for macOS in the code example below) in addition to the appropriate values for your new platform.

```shell
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxx
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/.config/gcloud/application_default_credentials.json

kubefirst beta gcp create \
--alerts-email [email protected] \
--github-org your-github-org \
--domain-name your-domain.io \
--cluster-name kubefirst
```

The kubefirst CLI will produce a directory of utilities, a state file, and some staged platform content that can now be found in the `~/.kubefirst` and `~/.k1` folders on your local machine.

After the ~10 minute installation, your browser will launch a new tab to the [kubefirst Console](https://github.com/kubefirst/console), which will help you navigate your new suite of tools running in your new Google Cloud cluster.

If your deployment is not successful, errors and troubleshooting information will be stored in a local log file specified during the installation run.

## Console UI Screen

![kubefirst console screen](../../../img/common/github/console.png)

## Example of terminal output following cluster creation

![terminal handoff](../../../img/gcp/github/handoff-screen.png)

## Root credentials

To obtain your 3 initial passwords, run

```bash
kubefirst beta gcp root-credentials
```

![terminal handoff](../../../img/common/kubefirst/root-credentials.png)

## Connecting to Kubernetes

To connect to your new Kubernetes cluster, run

```bash
export KUBECONFIG=~/.k1/kubeconfig
```

To view all cluster pods, run

```bash
kubectl get pods -A
```

### Installed Applications

To see what is installed by kubefirst, check the [overview page](../../overview.mdx).
16 changes: 16 additions & 0 deletions docs/gcp/partials/github/_overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
`kubefirst beta gcp create` provisions a local [Google Cloud](https://cloud.google.com) Kubernetes cluster to host your cloud native environment locally.

Your Google Cloud cluster will include:

| Application | Description |
|---------------------------------|-----------------------------------------------------------------------------|
| Argo CD | GitOps Continuous Delivery |
| Argo Workflows | Application Continuous Integration |
| Atlantis | Terraform Workflow Automation |
| cert-manager | Certificate Automation Utility |
| ChartMuseum | Helm Chart Registry |
| External Secrets Operators | Syncs Kubernetes secrets with Vault secrets |
| GitHub Action Runner Controller | GitHub Self-Hosted CI Executor |
| HashiCorp Vault | Secrets Management |
| Metaphor | (development, staging, production) instance of sample Next.js app |
| Ingress Nginx | Ingress Controller |
5 changes: 5 additions & 0 deletions docs/gcp/partials/github/_prerequisites.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### GitHub Prerequisites

- A GitHub [organisation](https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/creating-a-new-organization-from-scratch).
- A new GitHub [account](https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account) for your `kbot` automation user.
- A GitHub [personal access token](../../../common/git-auth.mdx) for your `kbot` account.
Loading

0 comments on commit efbed83

Please sign in to comment.