Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Added GCP Structure (#4477)
Browse files Browse the repository at this point in the history
* GCP

* Update index.md
  • Loading branch information
mmcelroy91 authored May 19, 2022
1 parent 9d32ae2 commit a17bd4f
Show file tree
Hide file tree
Showing 15 changed files with 797 additions and 17 deletions.
12 changes: 6 additions & 6 deletions pages/dkp/konvoy/2.3/Install/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
layout: layout.pug
navigationTitle: Install
title: Install
navigationTitle: Getting Started
title: Getting Started
menuWeight: 30
excerpt: Install a DKP cluster
beta: false
enterprise: false
---

When installing DKP for a project, line-of-business, or enterprise, the first step is to determine the infrastructure on which you want to deploy.
When installing DKP for a project, line-of-business, or enterprise, the first step is to determine the infrastructure provider on which you want to deploy.

For example, you can:

- Install on a public cloud infrastructure, such as Amazon Web Services (AWS) or Azure.
- Install on a public cloud infrastructure provider, such as Amazon Web Services (AWS) or Azure.
- Install on an internal network on-premises with a physical (bare metal) or virtual infrastructure.
- Install on air-gapped Edge.

Expand All @@ -24,7 +24,7 @@ By combining a native Kubernetes cluster as its foundation with a default set of
DKP provides a complete out-of-the-box solution for organizations that want to deploy production-ready
Kubernetes.

As an example, this Installation guide provides simplified instructions to get your DKP cluster up and running with minimal configuration requirements on an Amazon Web Services (AWS) public cloud instance. For information about installing on a different platform, see [Choose Infrastructure](../choose-infrastructure/).
As an example, this Installation guide provides simplified instructions to get your DKP cluster up and running with minimal configuration requirements on an Amazon Web Services (AWS) public cloud instance. For information about installing on a different platform, see [Infrastructure providers](../choose-infrastructure/).

# Before you begin

Expand All @@ -48,7 +48,7 @@ Before installing DKP, ensure you have the [following](../supported-operating-sy

1. Verify you have valid **cloud provider security credentials** to deploy the cluster on that platform. This step is not required if you are installing DKP on an on-premises environment. For information about installing in an on-premises environment, see [Install on-premises](../choose-infrastructure/on-prem).

1. Deploy with all of the default settings depending on which infrastructure you have. Go to the Choose Infrastructure section of the documentation for further steps on creating a cluster on your Cloud platform. [Choose Infrastructure](../choose-infrastructure/)
1. Deploy with all of the default settings depending on which infrastructure you have. Go to the Choose Infrastructure Providers section of the documentation for further steps on creating a cluster on your Cloud platform. [Infrastructure Providers](../choose-infrastructure/)

1. Lastly, you will want to [Install Kommander](/../../dkp/kommander/2.3/install/)

Expand Down
2 changes: 1 addition & 1 deletion pages/dkp/konvoy/2.3/choose-infrastructure/aks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ beta: false
enterprise: false
---

When installing Konvoy on Azure Kubernetes Service (**AKS**) infrastructure, you can choose from multiple configuration types. The different types of AKS configuration types supported in Konvoy are covered in this section.
When installing Konvoy on Azure Kubernetes Service (**AKS**), you can choose from multiple configuration types. The different types of AKS configuration types supported in Konvoy are covered in this section.
2 changes: 1 addition & 1 deletion pages/dkp/konvoy/2.3/choose-infrastructure/eks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ beta: false
enterprise: false
---

When installing Konvoy on EKS infrastructure, you can choose from multiple configuration types. The different EKS configuration types supported in Konvoy are listed below:
When installing Konvoy on EKS, you can choose from multiple configuration types. The different EKS configuration types supported in Konvoy are listed below:
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
layout: layout.pug
navigationTitle: Bootstrap
title: Bootstrap
menuWeight: 15
excerpt: Prepare to deploy Kubernetes clusters
enterprise: false
---

To create Kubernetes clusters, Konvoy uses [Cluster API][capi_book] (CAPI) controllers. These controllers run on a Kubernetes cluster. To get started, you need a _bootstrap_ cluster. By default, Konvoy creates a bootstrap cluster for you in a Docker container using the Kubernetes-in-Docker ([KIND][kind]) tool.

## Prerequisites
<!NEED CONFIRMATION OF STEPS PRE-RELEASE>
Before you begin, you must:

- Complete the steps in [Prerequisites][prerequisites].
- Ensure the `dkp` binary can be found in your `$PATH`.

## Bootstrap Cluster Lifecycle Services

1. If an HTTP proxy is required for the bootstrap cluster, set the local `http_proxy`, `https_proxy`, and `no_proxy` environment variables. They are copied into the bootstrap cluster.

1. Create a bootstrap cluster:

```bash
dkp create bootstrap --with-gcp-bootstrap-credentials=true --kubeconfig $HOME/.kube/config
```

```sh
✓ Creating a bootstrap cluster
✓ Initializing new CAPI components
```

Konvoy creates a bootstrap cluster using [KIND][kind] as a library. Konvoy then deploys the following [Cluster API][capi_book] providers on the cluster:

- [Core Provider][capi]
- [GCP Infrastructure Provider][capa]
- [Kubeadm Bootstrap Provider][cabpk]
- [Kubeadm ControlPlane Provider][kcp]

Konvoy waits until the controller-manager and webhook deployments of these providers are ready. List these deployments using this command:

```bash
kubectl get --all-namespaces deployments -l=clusterctl.cluster.x-k8s.io
```

```sh
NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
capa-system capa-controller-manager 1/1 1 1 3m17s
capi-kubeadm-bootstrap-system capi-kubeadm-bootstrap-controller-manager 1/1 1 1 3m18s
capi-kubeadm-control-plane-system capi-kubeadm-control-plane-controller-manager 1/1 1 1 3m18s
capi-system capi-controller-manager 1/1 1 1 3m18s
cappp-system cappp-controller-manager 1/1 1 1 3m14s
capv-system capv-controller-manager 1/1 1 1 3m14s
capz-system capz-controller-manager 1/1 1 1 3m15s
cert-manager cert-manager 1/1 1 1 3m29s
cert-manager cert-manager-cainjector 1/1 1 1 3m29s
cert-manager cert-manager-webhook 1/1 1 1 3m29s
```

Konvoy then creates additional resources for Cluster API to apply to every new cluster. The resources, called `ClusterResourceSets`, contain complete YAML manifests to deploy essential cluster applications, such as the [Calico][calico] Container Networking Interface (CNI) implementation, and Container Storage Interface (CSI) implementations for various infrastructure APIs. List ClusterResourceSets using this command:

```bash
kubectl get clusterresourceset
```

```sh
NAME AGE
calico-cni-installation-eks-example 42m
cluster-autoscaler-eks-example 42m
node-feature-discovery-eks-example 42m
nvidia-feature-discovery-eks-example 42m
```

A ClusterResourceSet object defines selectors that match against cluster labels, and a reference to a ConfigMap. The ConfigMap contains a YAML manifest. When a cluster with matching labels is created, the YAML manifest is applied to the cluster. The manifest is applied only once, when the cluster is created.

For example, this is the `node-feature-discovery` ClusterResourceSet, which is now deployed by Konvoy from the above actions:

```yaml
apiVersion: addons.cluster.x-k8s.io/v1alpha4
kind: ClusterResourceSet
metadata:
name: node-feature-discovery
spec:
clusterSelector:
matchExpressions:
- key: konvoy.d2iq.io/provider
operator: Exists
resources:
- kind: ConfigMap
name: node-feature-discovery
strategy: ApplyOnce
```

Konvoy defines the selectors and sets the correct labels on the Cluster objects. For a more detailed explanation of how ClusterResourceSets work, see the [Extension Proposal][clusterresourceset_caep].

[install_docker]: https://docs.docker.com/get-docker/
[install_kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
[gcp_credentials]: https://github.com/kubernetes-sigs/cluster-api-provider-gcp
[capa]: https://github.com/kubernetes-sigs/cluster-api-provider-gcp
[kind]: https://github.com/kubernetes-sigs/kind
[capi_book]: https://cluster-api.sigs.k8s.io/
[calico]: https://docs.projectcalico.org/
[capi]: https://github.com/kubernetes-sigs/cluster-api/tree/v0.3.20/
[kcp]: https://github.com/kubernetes-sigs/cluster-api/tree/v0.3.20/controlplane/kubeadm
[cabpk]: https://github.com/kubernetes-sigs/cluster-api/tree/v0.3.20/bootstrap/kubeadm
[clusterresourceset_caep]: https://github.com/kubernetes-sigs/cluster-api/blob/master/docs/proposals/20200220-cluster-resource-set.md
[prerequisites]: ../prerequisites
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
layout: layout.pug
navigationTitle: Delete Cluster
title: Delete Cluster
menuWeight: 40
excerpt: Delete the Kubernetes cluster and clean up your environment
enterprise: false
---

## Prepare to delete a self-managed workload cluster

<p class="message--note"><strong>NOTE: </strong>A self-managed workload cluster cannot delete itself. If your workload cluster is self-managed, you must create a bootstrap cluster and move the cluster lifecycle services to the bootstrap cluster before deleting the workload cluster.</p>

If you did not make your workload cluster self-managed, as described in [Make New Cluster Self-Managed](../advanced/self-managed), see [Delete the workload cluster](#delete-the-workload-cluster).

1. Create a bootstrap cluster:

The bootstrap cluster will host the Cluster API controllers that reconcile the cluster objects marked for deletion:

<p class="message--note"><strong>NOTE: </strong>To avoid using the wrong kubeconfig, the following steps use explicit kubeconfig paths and contexts.</p>

```bash
dkp create bootstrap --kubeconfig $HOME/.kube/config
```

```sh
✓ Creating a bootstrap cluster
✓ Initializing new CAPI components
```

1. Move the Cluster API objects from the workload to the bootstrap cluster:
The cluster lifecycle services on the bootstrap cluster are ready, but the workload cluster configuration is on the workload cluster. The `move` command moves the configuration, which takes the form of Cluster API Custom Resource objects, from the workload to the bootstrap cluster. This process is also called a [Pivot][pivot].

```bash
dkp move capi-resources \
--from-kubeconfig ${CLUSTER_NAME}.conf \
--from-context ${CLUSTER_NAME}-admin@${CLUSTER_NAME} \
--to-kubeconfig $HOME/.kube/config \
--to-context kind-konvoy-capi-bootstrapper
```

```sh
✓ Moving cluster resources
```

1. Use the cluster lifecycle services on the workload cluster to check the workload cluster status:

```bash
dkp describe cluster --kubeconfig $HOME/.kube/config -c ${CLUSTER_NAME}
```

```sh
NAME READY SEVERITY REASON SINCE MESSAGE
Cluster/gcp-example True 15s
├─ClusterInfrastructure - GCPCluster/gcp-example True 29s
├─ControlPlane - KubeadmControlPlane/gcp-example-control-plane True 15s
│ ├─Machine/gcp-example-control-plane-gvj5d True 22s
│ ├─Machine/gcp-example-control-plane-l8j9r True 23s
│ └─Machine/gcp-example-control-plane-xhxxg True 23s
└─Workers
└─MachineDeployment/gcp-example-md-0 True 35s
├─Machine/gcp-example-md-0-d67567c8b-2674r True 24s
├─Machine/gcp-example-md-0-d67567c8b-n276j True 25s
├─Machine/gcp-example-md-0-d67567c8b-pzg8k True 23s
└─Machine/gcp-example-md-0-d67567c8b-z8km9 True 24s
```

<p class="message--note"><strong>NOTE: </strong>After moving the cluster lifecycle services to the workload cluster, remember to use dkp with the workload cluster kubeconfig.</p>

Use dkp with the bootstrap cluster to delete the workload cluster.

1. Wait for the cluster control-plane to be ready:

```bash
kubectl --kubeconfig $HOME/.kube/config wait --for=condition=controlplaneready "clusters/${CLUSTER_NAME}" --timeout=60m
```

```sh
cluster.cluster.x-k8s.io/gcp-example condition met
```
## Delete the workload cluster
<!NEED CONFIRMATION OF STEPS PRE-RELEASE>!

1. Make sure your GCP credentials are up to date. Refresh the credentials using this command:

```bash
dkp update bootstrap credentials gcp --kubeconfig $HOME/.kube/config
```

1. Delete the Kubernetes cluster and wait a few minutes:

Before deleting the cluster, dkp deletes all Services of type LoadBalancer on the cluster.
To skip this step, use the flag `--delete-kubernetes-resources=false`.

```bash
dkp delete cluster --cluster-name=${CLUSTER_NAME} --kubeconfig $HOME/.kube/config
```

```sh
✓ Deleting Services with type LoadBalancer for Cluster default/gcp-example
✓ Deleting ClusterResourceSets for Cluster default/azure-example
✓ Deleting cluster resources
✓ Waiting for cluster to be fully deleted
Deleted default/gcp-example cluster
```

After the workload cluster is deleted, delete the bootstrap cluster.

## Delete the bootstrap cluster

```bash
dkp delete bootstrap --kubeconfig $HOME/.kube/config
```

```sh
✓ Deleting bootstrap cluster
```

[pivot]: https://cluster-api.sigs.k8s.io/reference/glossary.html?highlight=pivot#pivot

## Known Limitations

<p class="message--note"><strong>NOTE: </strong>Be aware of these limitations in the current release of Konvoy.</p>

- The Konvoy version used to create the workload cluster must match the Konvoy version used to delete the workload cluster.


[makeselfmanaged]: ../self-managed
11 changes: 11 additions & 0 deletions pages/dkp/konvoy/2.3/choose-infrastructure/gcp/advanced/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
layout: layout.pug
navigationTitle: Install GCP Advanced
title: Install GCP Advanced
excerpt: Install Konvoy with GCP using advanced configuration options.
subtree:
beta: false
menuWeight: 20
---

This section provides GCP advanced configuration information to use with Konvoy.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
layout: layout.pug
navigationTitle: Create a New Cluster
title: Create a New Cluster
menuWeight: 20
excerpt: Use Konvoy to create a new Kubernetes cluster
enterprise: false
---

## Prerequisites

- Before you begin, make sure you have created a [Bootstrap][bootstrap] cluster.

## Create a new GCP cluster
<!NEED CONFIRMATION OF STEPS PRE-RELEASE>
1. Create the cluster:

```
kubectl apply -f $CLUSTER_NAME/cluster.yaml
```
7. Tail the CAPG controller logs:
```
kubectl logs -n capg-system -l cluster.x-k8s.io/provider=infrastructure-gcp -f
```
8. Check the status of the cluster
```
clusterctl describe cluster $CLUSTER_NAME
```
## Explore the cluster
1. Get the kubeconfig:
```
clusterctl get kubeconfig $CLUSTER_NAME > $CLUSTER_NAME/$CLUSTER_NAME.conf
export KUBECONFIG=$CLUSTER_NAME/$CLUSTER_NAME.conf
```
1. Verify the API server is up (the Nodes will not be ready until CSI is deployed):
```
kubectl get nodes
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: layout.pug
navigationTitle: Prerequisites
title: Prerequisites
menuWeight: 10
excerpt: Prepare your machine and environment to run DKP
enterprise: true
---

## Konvoy prerequisites

Before you begin using Konvoy, you must have:

- An x86_64-based Linux or macOS machine.
- The `dkp` binary for Linux, or macOS.
- [Docker][install_docker] version 18.09.2 or later installed.
- [kubectl][install_kubectl] for interacting with the running cluster.
- A valid AWS account with [credentials configured][gcp_credentials].
- Installation of ????

<p class="message--note"><strong>NOTE: </strong>On macOS, Docker runs in a virtual machine. Configure this virtual machine with at least 8GB of memory.</strong></p>

## GCP prerequisites

Before you begin using Konvoy with GCP, you must:

- Create an ????.

- Export the GCP region where you want to deploy the cluster:

```bash
export GCP_REGION=us-west-2
```

- Export the GCP profile with the credentials you want to use to create the Kubernetes cluster:

```bash
export GCP_PROFILE=<profile>
```


[gcp_credentials]: https://github.com/kubernetes-sigs/cluster-api-provider-gcp

[install_docker]: https://docs.docker.com/get-docker/
[install_kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
Loading

0 comments on commit a17bd4f

Please sign in to comment.