-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mondragonfx/master
Generate additional Vultr resources
- Loading branch information
Showing
83 changed files
with
12,258 additions
and
333 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Building and Installing the Crossplane Vultr Provider | ||
|
||
`provider-vultr` is composed of a golang project and can be built directly with standard `golang` tools. We currently support two different platforms for building: | ||
|
||
* Linux: most modern distros should work although most testing has been done on Ubuntu | ||
* Mac: macOS 10.6+ is supported | ||
|
||
## Build Requirements | ||
|
||
An Intel-based machine (recommend 2+ cores, 2+ GB of memory and 128GB of SSD). Inside your build environment (Docker for Mac or a VM), 6+ GB memory is also recommended. | ||
|
||
The following tools are need on the host: | ||
|
||
* curl | ||
* docker (1.12+) or Docker for Mac (17+) | ||
* git | ||
* make | ||
* golang | ||
* rsync (if you're using the build container on mac) | ||
* helm (v2.8.2+) | ||
* kubebuilder (v1.0.4+) | ||
|
||
## Build | ||
You can build the Crossplane Vultr Provider for the host platform by simply running the command below. | ||
Building in parallel with the `-j` option is recommended. | ||
|
||
```console | ||
make -j4 | ||
``` | ||
|
||
The first time `make` is run, the build submodule will be synced and | ||
updated. After initial setup, it can be updated by running `make submodules`. | ||
|
||
Run `make help` for more options. | ||
|
||
## Building inside the cross container | ||
|
||
Official Crossplane builds are done inside a build container. This ensures that we get a consistent build, test and release environment. To run the build inside the cross container run: | ||
|
||
```console | ||
build/run make -j4 | ||
``` | ||
|
||
The first run of `build/run` will build the container itself and could take a few minutes to complete, but subsequent builds should go much faster. | ||
|
||
## Install Crossplane in Your Cluster | ||
Once your Cluster is up and running, you'll need to install Crossplane. | ||
|
||
We recommend using Helm to install Crossplane. You can find the [official documentation here](https://crossplane.io/docs/v1.5/getting-started/install-configure.html#install-crossplane). These are the commands: | ||
|
||
```console | ||
kubectl create namespace crossplane-system | ||
|
||
helm repo add crossplane-stable https://charts.crossplane.io/stable | ||
helm repo update | ||
|
||
helm install crossplane --namespace crossplane-system crossplane-stable/crossplane | ||
``` | ||
|
||
## Getting started | ||
|
||
Next install this Vultr Crossplane provider: | ||
```bash | ||
# clone this repo | ||
git clone [email protected]:vultr/crossplane-provider-vultr.git | ||
cd provider-vultr | ||
|
||
# install the crds | ||
kubectl apply -f package/crds | ||
``` | ||
|
||
Run the provider: | ||
```bash | ||
make run | ||
``` | ||
|
||
Configure the provider: | ||
```bash | ||
# change the examples/secret.yaml to use your VULTR_API_KEY | ||
kubectl apply -f examples/providerconfig/secret.yaml | ||
kubectl apply -f examples/providerconfig/providerconfig.yaml | ||
``` | ||
|
||
|
||
## Provision Vultr Resources | ||
|
||
Go to the [examples-generated](./examples-generated) directory in this repo, find the Vultr product you'd like to deploy, make any needed changes to the yaml file, and then create the resource. | ||
|
||
For example, if you'd like to spin up a VKE Cluster, run the command | ||
|
||
```console | ||
kubectl apply -f examples-generated/vultr/kubernetes.yaml | ||
# wait a bit | ||
kubectl get managed | ||
``` | ||
and check your Vultr account to see if the resource has been created. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,56 +5,68 @@ is built using [Upjet](https://github.com/upbound/upjet) code | |
generation tools and exposes XRM-conformant managed resources for the | ||
Vultr API. | ||
|
||
## Getting Started | ||
## Overview | ||
|
||
Install the provider by using the following command after changing the image tag | ||
to the [latest release](https://marketplace.upbound.io/providers/crossplane-contrib/provider-vultr): | ||
``` | ||
up ctp provider install crossplane-contrib/provider-vultr:v0.1.0 | ||
``` | ||
This `provider-vultr` repository is the Crossplane infrastructure provider for | ||
[vultr](https://vultr.com/). The provider that is built from | ||
the source code in this repository can be installed into a Crossplane control | ||
plane and adds the following new functionality: | ||
|
||
Alternatively, you can use declarative installation: | ||
``` | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: pkg.crossplane.io/v1 | ||
kind: Provider | ||
metadata: | ||
name: provider-vultr | ||
spec: | ||
package: crossplane-contrib/provider-vultr:v0.1.0 | ||
EOF | ||
``` | ||
* Custom Resource Definitions (CRDs) that model vultr infrastructure and managed | ||
services (e.g. [Vultr Kubernetes Engine](https://www.vultr.com/kubernetes/), [Vultr Loadbalancers](https://www.vultr.com/products/load-balancers/), | ||
etc.) | ||
* Controllers to provision these resources in vultr based on the users desired | ||
state captured in CRDs they create | ||
* Implementations of Crossplane's portable resource abstractions, enabling vultr | ||
resources to fulfill a user's general need for cloud services | ||
|
||
Notice that in this example Provider resource is referencing ControllerConfig with debug enabled. | ||
## Getting Started and Documentation | ||
|
||
You can see the API reference [here](https://doc.crds.dev/github.com/crossplane-contrib/provider-vultr). | ||
For getting started guides, installation, deployment, and administration, see | ||
our [Documentation](https://crossplane.io/docs/latest). | ||
|
||
## Developing | ||
## Contributing | ||
|
||
Run code-generation pipeline: | ||
```console | ||
go run cmd/generator/main.go "$PWD" | ||
``` | ||
provider-vultr is a community driven project and we welcome contributions. See | ||
the Crossplane | ||
[Contributing](https://github.com/crossplane/crossplane/blob/master/CONTRIBUTING.md) | ||
guidelines to get started. | ||
|
||
Run against a Kubernetes cluster: | ||
## Report a Bug | ||
|
||
```console | ||
make run | ||
``` | ||
For filing bugs, suggesting improvements, or requesting new features, please | ||
open an [issue](https://github.com/vultr/crossplane-provider-vultr/issues). | ||
|
||
Build, push, and install: | ||
## Contact | ||
|
||
```console | ||
make all | ||
``` | ||
Please use the following to reach members of the community: | ||
|
||
Build binary: | ||
- Slack: Join our [slack channel](https://slack.crossplane.io) | ||
- Forums: | ||
[crossplane-dev](https://groups.google.com/forum/#!forum/crossplane-dev) | ||
- Twitter: [@crossplane_io](https://twitter.com/crossplane_io) | ||
- Email: [[email protected]](mailto:[email protected]) | ||
|
||
```console | ||
make build | ||
``` | ||
## Roadmap | ||
|
||
## Report a Bug | ||
provider-vultr goals and milestones are currently tracked in the Crossplane | ||
repository. More information can be found in | ||
[ROADMAP.md](https://github.com/crossplane/crossplane/blob/master/ROADMAP.md). | ||
|
||
## Governance and Owners | ||
|
||
provider-vultr is run according to the same | ||
[Governance](https://github.com/crossplane/crossplane/blob/master/GOVERNANCE.md) | ||
and [Ownership](https://github.com/crossplane/crossplane/blob/master/OWNERS.md) | ||
structure as the core Crossplane project. | ||
|
||
## Code of Conduct | ||
|
||
provider-vultr adheres to the same [Code of | ||
Conduct](https://github.com/crossplane/crossplane/blob/master/CODE_OF_CONDUCT.md) | ||
as the core Crossplane project. | ||
|
||
## Licensing | ||
|
||
provider-vultr is under the Apache 2.0 license. | ||
|
||
For filing bugs, suggesting improvements, or requesting new features, please | ||
open an [issue](https://github.com/crossplane-contrib/provider-vultr/issues). |
55 changes: 45 additions & 10 deletions
55
.../object/v1alpha1/zz_generated.deepcopy.go → apis/block/v1alpha1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ject/v1alpha1/zz_generated_terraformed.go → ...lock/v1alpha1/zz_generated_terraformed.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
apis/object/v1alpha1/zz_groupversion_info.go → apis/block/v1alpha1/zz_groupversion_info.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.