Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ Look in [docs/mappings](docs/mappings) for information on each supported resourc
Please have a look at the [`docs`](docs/README.md) for information on getting started using
the operator.

To deploying and using the operator look at [`deploying`](docs/guides/deployment.md)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about this slight tweak?

Suggested change
To deploying and using the operator look at [`deploying`](docs/guides/deployment.md)
For deploying and using the operator, look at [`deploying`](docs/guides/deployment.md)


### Editions

This operator works with both the Community and Enterprise editions of the Ververica Platform, with the caveats:

* `VpNamespaces` are not supported by the Community Edition, so the manager will not register those resources
* The `spec.metadata.namespace` field must either be left unset or set explicitly to `default` for all `Vp` resources

Expand All @@ -53,6 +56,7 @@ Find out more about [the editions here](https://www.ververica.com/pricing-editio
To run the binary directly, after building run `./bin/manager`.

**Flags:**

* `--help` prints usage
* `--vvp-url=http://localhost:8081` the url, without trailing slash, for the Ververica Platform
* `--vvp-edition=enterprise` the Ververica Platform Edition to support. See [Editions](#Editions) for more.
Expand All @@ -69,12 +73,14 @@ for each namespace that resources are managed in.
Specifying in the environment is a good way to integrate with namespaces that aren't defined in Kubernetes.

**Environment:**

* `APPMANAGER_API_TOKEN_{NAMESPACE}` a token to use for resources in a specific Ververica Platform namespace, upper-cased
* `APPMANAGER_API_TOKEN` if no namespace-specific token can be found, this value will be used.

## Docker

Images are published to [Docker Hub](https://hub.docker.com/r/fintechstudios/ververica-platform-k8s-operator).

* The `latest` tag always refers to the current HEAD in the master branch.
* Each master commit hash is also tagged and published.
* Git tags are published with the same tag.
Expand All @@ -100,6 +106,7 @@ in [docs/design.md](docs/design.md).
Also built as a Go module - no vendor files here.

System Pre-requisites:

- `go` >= `1.14.x`
- `make` >= `4`
- `kubebuilder` == [`v2.2.0`](https://github.com/kubernetes-sigs/kubebuilder/releases/tag/v2.2.0)
Expand Down Expand Up @@ -155,19 +162,20 @@ The `optional` package is missing from many of the imports in the generated code
package ververicaplatformapi

import (
// ...
// ...
"github.com/antihax/optional"
// ...
)
```

Affected files:

- `api_event_resource.go`
- `api_job_resource.go`
- `api_savepoint_resource.go`


Type Changes:

* `model_pods.go` needs to be updated with the proper Kubernetes types
* `model_volume_and_mount.go` needs to be updated with the proper Kubernetes types

Expand All @@ -188,6 +196,7 @@ You'll also have to change any usages of this type in `structs` to be embedded,
### Building Images

The images are built in two steps:

1. The [`build.Dockerfile`](build.Dockerfile) image is a full development environment for running tests, linting,
and building the source with the correct tooling. This can also be used for development if you so like,
just override the entrypoint.
Expand All @@ -198,6 +207,7 @@ the manager binary and copies it over into an image for distribution.
## Acknowledgements

Other OSS that influenced this project:

* [Kong Ingress Controller](https://github.com/Kong/kubernetes-ingress-controller)

## License
Expand Down
55 changes: 55 additions & 0 deletions docs/guides/cert-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Install cert-manager

Install the CustomResourceDefinition resources separately.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Could we also just add a link to their official install guide in case this becomes outdated?


```bash
# Kubernetes 1.15+
$ kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.14.3/cert-manager.crds.yaml

# Kubernetes <1.15
$ kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.14.3/cert-manager-legacy.crds.yaml
```

Create the namespace for cert-manager.

```bash
kubectl create namespace cert-manager
```

Add the Jetstack Helm repository.

```bash
helm repo add jetstack https://charts.jetstack.io
```

Update your local Helm chart repository cache.

```bash
helm repo update
```

Install the cert-manager Helm chart.

```bash
# For Helm v3+
$ helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--version v0.14.3

# For Helm v2
$ helm install \
--name cert-manager \
--namespace cert-manager \
--version v0.14.3 \
jetstack/cert-manager
```

Wait for the deployment to come up

```bash
$ kubectl --namespace cert-manager wait --for=condition=available deployments --all
deployment.extensions/cert-manager condition met
deployment.extensions/cert-manager-cainjector condition met
deployment.extensions/cert-manager-webhook condition met
```
100 changes: 75 additions & 25 deletions docs/guides/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,15 @@ running in the cluster to provision certificates for the CRD webhooks.
For the most up-to-date guide, refer to [the official getting started guide](https://www.ververica.com/getting-started).

```shell
# 0.
# Add the Ververica chart repository
# 0. Add the Ververica chart repository
helm repo add ververica https://charts.ververica.com

# 1.
# Deploy the Ververica Platform
# 1. Deploy the Ververica Platform

# For deploying jobs into namespaces outside of the VVP deployment namespace,
# specify the `rbac.additionalNamespaces` value with a set of namespaces.
# In this case, add the `top-speed` namespace associated with the sample manifests in `/config/samples`.

# Create the `top-speed` namespace if it doesn't exist
kubectl create namespace top-speed || true
Copy link
Copy Markdown
Contributor

@austince austince May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could keep this in? Installing the VVP with the additional namespace support was failing for me yesterday if the namespace didn't already exist.


## For the Enterprise Edition
helm install --namespace vvp \
--name vvp \
Expand All @@ -33,21 +28,42 @@ helm install --namespace vvp \
--set rbac.additionalNamespaces={top-speed}

## Or, for the Community Edition
For helm 2:

```bash
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these extra ```bash sections are throwing off something with rendering. Could we remove them and just keep the whole thing in the ```shell block?

helm install --namespace vvp \
--name vvp \
ververica/ververica-platform \
--set acceptCommunityEditionLicense=true \
--set rbac.additionalNamespaces={top-speed}
```

# 2.
# Wait for the deployment to come up
For helm 3:

```bash
helm install vvp ververica/ververica-platform -n vvp --set acceptCommunityEditionLicense=true
```

## 2.Wait for the deployment to come up

```bash
kubectl --namespace vvp wait --for=condition=available deployments --all
```

## 3. Access the platform UI locally at port 8080

# 3.
# Access the platform UI locally at port 8080
kubectl port-forward --namespace vvp service/vvp-ververica-platform 8080:80 &
```bash
kubectl port-forward --namespace vvp service/vvp-ververica-platform 8080:80
```

NOTE: If you don't have cert-manager you may get following error:

```bash
Error: Internal error occurred: failed calling webhook "webhook.cert-manager.io": Post https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=30s: no endpoints available for service "cert-manager-webhook"
```

To deploy cert-manager[`check out this guide`](./cert-manager.md)
Comment on lines +59 to +65
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about moving this to the top of the guide where Cert-Manager is mentioned?


### Installing the Operator

Until there is a Helm chart repository set up for this operator, copies of the charts
Expand All @@ -58,11 +74,10 @@ in the same namespace as the Ververica Platform.
This guide assumes you are operating in the base `ververica-platform-k8s-operator` directory.

```shell
# 4.
# Install the Operator
# 4. Install the Operator
# Pointed at the service deployed with the Ververica Platform.
# NOTE: the pods might crash on startup and enter a restart loop until the CRDs
# are present, but this should be fine.
# are present, but this should be fine.

## Enterprise
helm install --namespace vvp \
Expand All @@ -72,24 +87,58 @@ helm install --namespace vvp \
--set vvpUrl=http://vvp-ververica-platform

## Community

### For helm 2:
helm install --namespace vvp \
--name vp-k8s-operator \
./charts/vp-k8s-operator \
--set vvpEdition=community \
--set vvpUrl=http://vvp-ververica-platform

# 5.
# Install the CRDs
# Using the Cert created by the operator chart for serving webhooks.
# Pointed at the webhook conversion service of the operator.
### For helm 3:
# Try dryrun to check the rendered templates
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the Helm 3 docs! Do you think we could remove the dry run bits though? I think it would be best if people could just run each of these commands and have it deploy without modification.

$ helm install -n vvp vp-k8s-operator ./charts/vp-k8s-operator \
--set vvpEdition=community \
--set vvpUrl=http://vvp-ververica-platform --dry-run

# Deploy the chart
$ helm install -n vvp vp-k8s-operator ./charts/vp-k8s-operator \
--set vvpEdition=community \
--set vvpUrl=http://vvp-ververica-platform
```


## 5.Install the CRDs

### Using the Cert created by the operator chart for serving webhooks

Pointed at the webhook conversion service of the operator.

With helm2:

```bash
helm install --namespace vvp \
--name vp-k8s-operator-crds \
./charts/vp-k8s-operator-crds \
--set webhookCert.name=vp-k8s-operator-serving-cert \
--set webhookService.name=vp-k8s-operator-webhook-service
```

# 6.
# Wait for the deployment to come up
```bash
# Try dryrun to check the rendered templates
$ helm install -n vvp vp-k8s-operator-crds ./charts/vp-k8s-operator-crds \
--set webhookCert.name=vp-k8s-operator-serving-cert \
--set webhookService.name=vp-k8s-operator-webhook-service --dry-run

# Deploy
$ helm install -n vvp vp-k8s-operator-crds ./charts/vp-k8s-operator-crds \
--set webhookCert.name=vp-k8s-operator-serving-cert \
--set webhookService.name=vp-k8s-operator-webhook-service
```

## 6. Wait for the deployment to come up

```bash
kubectl --namespace vvp wait --for=condition=available deployments --all
```

Expand All @@ -98,17 +147,18 @@ kubectl --namespace vvp wait --for=condition=available deployments --all
The samples can all be deployed through `kubectl`.

```shell
# 7.
# Install the samples in the top-speed namespace.
# 7. Install the samples in the top-speed namespace.

# Create namespace if it doesn't exist
kubectl create namespace top-speed || true

# Create the VpDeploymentTarget
kubectl apply -f config/samples/ververicaplatform_v1beta2_vpdeploymenttarget.yaml

# Create the VpDeployment
kubectl apply -f config/samples/ververicaplatform_v1beta2_vpdeployment.yaml

# 8.
# Watch the Top Speed V2 deployment come online
# 8. Watch the Top Speed V2 deployment come online

# Visit http://localhost:8080/app/#/namespaces/default/deployments to see the UI

Expand Down