Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: JSON example. #355

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 40 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- markdownlint-disable MD033 MD041 -->
<!-- markdownlint-disable MD033 MD041 MD024 -->
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="images/kubefirst-light.svg" alt="Kubefirst Logo">
Expand Down Expand Up @@ -94,7 +94,6 @@ Some variables are required, others are optional depending on deployment type.
| `K1_LOCAL_DEBUG` | Identifies the api execution as local debug mode | Yes |
| `K1_LOCAL_KUBECONFIG_PATH` | kubeconfig path location for k3d local cluster | Yes |


## local environment variables

see [this .env example](./.env.example) for the necessary values
Expand Down Expand Up @@ -146,6 +145,18 @@ If there is no `Secret`, the API will then attempt to read from the parameters p

This would require the following parameters added to the API call depending on which cloud provider is being used:

##### Akamai

```json
{
"akamai_auth": {
"token": "my-akamai-token"
}
}
```

##### AWS

```json
{
"aws_auth": {
Expand All @@ -156,6 +167,8 @@ This would require the following parameters added to the API call depending on w
}
```

##### Civo

```json
{
"civo_auth": {
Expand All @@ -164,6 +177,8 @@ This would require the following parameters added to the API call depending on w
}
```

##### DigitalOcean

```json
{
"do_auth": {
Expand All @@ -174,15 +189,19 @@ This would require the following parameters added to the API call depending on w
}
```

##### Google Cloud

```json
{
"do_auth": {
"gcp_auth": {
"key_file": "my-google-credentials-json-keyfile-stringified-no-newline-characters",
"project_id": "google cloud project id"
}
}
```

##### Vultr

```json
{
"vultr_auth": {
Expand All @@ -193,38 +212,48 @@ This would require the following parameters added to the API call depending on w

If either of these options is missing, the API will return an error.

### AWS
#### API Call

##### Akamai

You must use the authentication strategy above to set credentials before running.

```shell
curl -X POST http://localhost:8081/api/v1/cluster/kf-api-scott-test -H "Content-Type: application/json" -d '{"admin_email": "scott@kubeshop.io", "cloud_provider": "aws", "cloud_region": "us-east-1", "domain_name": "kubefirst.cloud", "git_owner": "kubefirst-cloud", "git_provider": "github", "git_token": "ghp_...", "type": "mgmt"}'
curl -X POST http://localhost:8081/api/v1/cluster/my-cool-cluster -H "Content-Type: application/json" -d '{"admin_email": "your@email.com", "cloud_provider": "akamai", "domain_name": "kubefirst.cloud", "git_owner": "kubefirst-cloud", "git_provider": "github", "git_token": "ghp_...", "type": "mgmt"}'
```

### Civo
##### AWS

You must use the authentication strategy above to set credentials before running.

```shell
curl -X POST http://localhost:8081/api/v1/cluster/my-cool-cluster -H "Content-Type: application/json" -d '{"admin_email": "scott@kubeshop.io", "cloud_provider": "civo", "cloud_region": "nyc1", "domain_name": "your-dns.io", "git_owner": "your-dns-io", "git_provider": "github", "git_token": "ghp_...", "type": "mgmt"}'
curl -X POST http://localhost:8081/api/v1/cluster/my-cool-cluster -H "Content-Type: application/json" -d '{"admin_email": "your@email.com", "cloud_provider": "aws", "cloud_region": "us-east-1", "domain_name": "kubefirst.cloud", "git_owner": "kubefirst-cloud", "git_provider": "github", "git_token": "ghp_...", "type": "mgmt"}'
```

### DigitalOcean
##### Civo

You must use the authentication strategy above to set credentials before running.

```shell
curl -X POST http://localhost:8081/api/v1/cluster/my-cool-cluster -H "Content-Type: application/json" -d '{"admin_email": "your@email.com", "cloud_provider": "civo", "cloud_region": "nyc1", "domain_name": "your-dns.io", "git_owner": "your-dns-io", "git_provider": "github", "git_token": "ghp_...", "type": "mgmt"}'
```

##### DigitalOcean

Kubefirst does not create a DigitalOcean space for you. You must create one ahead of time and provide the key and secret when creating a DigitalOcean cluster. The space acts as an S3-compatible storage bucket for Terraform state and other cluster operations.

You must use the authentication strategy above to set credentials before running.

```shell
curl -X POST http://localhost:8081/api/v1/cluster/my-cool-cluster -H "Content-Type: application/json" -d '{"admin_email": "scott@kubeshop.io", "cloud_provider": "digitalocean", "cloud_region": "nyc3", "domain_name": "kubefunk.de", "git_owner": "kubefunk-de", "git_provider": "github", "git_token": "ghp_...", "type": "mgmt"}'
curl -X POST http://localhost:8081/api/v1/cluster/my-cool-cluster -H "Content-Type: application/json" -d '{"admin_email": "your@email.com", "cloud_provider": "digitalocean", "cloud_region": "nyc3", "domain_name": "kubefunk.de", "git_owner": "kubefunk-de", "git_provider": "github", "git_token": "ghp_...", "type": "mgmt"}'
```

### Vultr
##### Vultr

You must use the authentication strategy above to set credentials before running.

```shell
curl -X POST http://localhost:8081/api/v1/cluster/my-cool-cluster -H "Content-Type: application/json" -d '{"admin_email": "scott@kubeshop.io", "cloud_provider": "vultr", "cloud_region": "ewr", "domain_name": "kubesecond.com", "git_owner": "your-dns-io", "git_provider": "github", "git_token": "ghp_...", "type": "mgmt"}'
curl -X POST http://localhost:8081/api/v1/cluster/my-cool-cluster -H "Content-Type: application/json" -d '{"admin_email": "your@email.com", "cloud_provider": "vultr", "cloud_region": "ewr", "domain_name": "kubesecond.com", "git_owner": "your-dns-io", "git_provider": "github", "git_token": "ghp_...", "type": "mgmt"}'
```

### Deleting a Cluster
Expand Down Expand Up @@ -264,4 +293,3 @@ go install github.com/swaggo/swag/cmd/swag@latest
```shell
make updateswagger
```