-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb340dd
commit 0a3170e
Showing
14 changed files
with
145 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
title: Setting Up an SCM Connection | ||
description: Connecting Plural to a Source Control Management Provider | ||
--- | ||
|
||
# Prerequisites | ||
* **Plural Console `admin` Permissions** | ||
* **SCM Provider Personal Access Token** | ||
* [Github](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) | ||
* [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token) | ||
* [Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/access-tokens/) | ||
* **SCM Provider Organization `admin` Permissions** | ||
* This is only required when creating the webhook | ||
* The workload cluster can still be created without the SCM webhook | ||
|
||
# Set Up | ||
### Create a New SCM Connection | ||
* **Navigate to `https://console.[YOUR DOMAIN].onplural.sh/pr/scm`** | ||
* **Click the _Create Connection_ Button at the Top Right** | ||
![Create SCM Connection Button](/images/how-to/console_create-scm-btn.png) | ||
|
||
* **Fil in the Required Fields** | ||
* **Provider Type**: The SCM Provider Hosting Git Repositories | ||
* **Name**: Reference Name for the Provider | ||
* ℹ️ **NOTE**: The _cluster-creator_ PR Automation looks for `github` by default | ||
* **Token**: The Deploy Token to use | ||
|
||
![Create SCM Connection Modal](/images/how-to/console_create-scm-modal.png) | ||
|
||
### **Create an [`ScmConnection`](https://docs.plural.sh/deployments/operator/api#scmconnection) CRD Instance** | ||
Once the connection is created in the UI we can reference it with a CRD instance | ||
* ❕ Ensure the Name Provided in the UI matches the `spec.name` in the CRD Exactly | ||
* The [`ScmConnection`](https://docs.plural.sh/deployments/operator/api#scmconnection) yaml can be saved in your MGMT Cluster Repo | ||
* You can use `kubectl` to apply it to the MGMT cluster | ||
```yaml | ||
apiVersion: deployments.plural.sh/v1alpha1 | ||
kind: ScmConnection | ||
metadata: | ||
name: github | ||
spec: | ||
name: github | ||
type: GITHUB | ||
``` | ||
### **Add an SCM Provider Webhook** | ||
If you navigate to `https://console.[YOUR DOMAIN].onplural.sh/pr/queue` | ||
You'll see even though the SCM connection is complete | ||
and the PR is merged the status of the cluster creator PR is still _open_ | ||
|
||
We need to add an SCM Webhook to fix this. | ||
* **Navigate to `https://console.[YOUR DOMAIN].onplural.sh/pr/scm-webhooks`** | ||
* **Click the `Create Webhook` Button** | ||
![](/images/how-to/create-scm-webhook-btn.png) | ||
* **Fill the Required Fields** | ||
* **Provider Type**: The SCM Provider Hosting Git Repositories | ||
* This may be obvious, but you need to select the same provider as the console webhook | ||
* **Owner**: The Organization or Group Within the SCM Provider | ||
* **Secret**: The Webhook Secret to Share | ||
![](/images/how-to/create-scm-webhook-modal-0.png) | ||
* **Click `Create`** | ||
* Copy the Webhook URL and note the secret to use within the SCM Provider Webhook | ||
![](/images/how-to/create-scm-webhook-modal-1.png) | ||
|
||
|
||
* **Create the Webhook with the SCM Provider** | ||
❕ You Must be an Owner or Have Admin Access to Create Webhooks | ||
* [GitHub Organization Webhooks](https://docs.github.com/en/webhooks/using-webhooks/creating-webhooks#creating-an-organization-webhook) | ||
* [GitLab Group Webhooks](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#group-webhooks) | ||
* [Bitbucket Webhooks](https://confluence.atlassian.com/bitbucketserver/manage-webhooks-938025878.html) | ||
|
||
|
||
|
||
|
||
# Troubleshooting | ||
|
||
#### Get Kubeconfig for the MGMT Cluster | ||
```sh | ||
plural wkspace kube-init | ||
``` | ||
|
||
Use `kubectl` with the newly added kube context | ||
The key namespaces to check are: | ||
* plrl-console | ||
* plrl-deploy-operator | ||
* plrl-runtime | ||
|
||
#### Check the Status of the SCM Connection | ||
```sh | ||
kubectl describe ScmConnection github | ||
``` | ||
Take note of the status conditions. | ||
The Messages will provide failure or success messages. |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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