This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
797 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
pages/dkp/konvoy/2.3/choose-infrastructure/gcp/advanced/bootstrap/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
128 changes: 128 additions & 0 deletions
128
pages/dkp/konvoy/2.3/choose-infrastructure/gcp/advanced/delete/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
pages/dkp/konvoy/2.3/choose-infrastructure/gcp/advanced/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
48 changes: 48 additions & 0 deletions
48
pages/dkp/konvoy/2.3/choose-infrastructure/gcp/advanced/new/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
45 changes: 45 additions & 0 deletions
45
pages/dkp/konvoy/2.3/choose-infrastructure/gcp/advanced/prerequisites/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
Oops, something went wrong.