cf-operator

module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2019 License: Apache-2.0

README

cf-operator

godoc master go report card Coveralls github

Nightly build nightly

cf-operator enables the deployment of BOSH Releases, especially Cloud Foundry, to Kubernetes.

It's implemented as a k8s operator, an active controller component which acts upon custom k8s resources.

Installing

Using the helm chart

The cf-operator can be installed via helm. Make sure you have a running Kubernetes cluster and that tiller is reachable.

Use this if you've never installed the operator before

helm install --namespace cf-operator --name cf-operator https://s3.amazonaws.com/cf-operators/helm-charts/cf-operator-v0.3.0%2B1.g551e559.tgz

Use this if the custom resources have already been created by a previous CF Operator installation

helm install --namespace cf-operator --name cf-operator https://s3.amazonaws.com/cf-operators/helm-charts/cf-operator-v0.3.0%2B1.g551e559.tgz --set "customResources.enableInstallation=false"

For more information about the cf-operator helm chart and how to configure it, please refer to deploy/helm/cf-operator/README.md

Recovering from a crash

If the operator pod crashes, it cannot be restarted in the same namespace before the existing mutating webhook configuration for that namespace is removed. The operator uses mutating webhooks to modify pods on the fly and Kubernetes fails to create pods if the webhook server is unreachable. The webhook configurations are installed cluster wide and don't belong to a single namespace, just like custom resources.

To remove the webhook configurations for the cf-operator namespace run:

CF_OPERATOR_NAMESPACE=cf-operator
kubectl delete mutatingwebhookconfiguration "cf-operator-hook-$CF_OPERATOR_NAMESPACE"
kubectl delete validatingwebhookconfiguration "cf-operator-hook-$CF_OPERATOR_NAMESPACE"

Using your fresh installation

With a running cf-operator pod, you can try one of the files (see docs/examples/bosh-deployment/boshdeployment-with-custom-variable.yaml ), as follows:

kubectl -n cf-operator create -f docs/examples/bosh-deployment/boshdeployment-with-custom-variable.yaml

The above will spawn two pods in your cf-operator namespace (which needs to be created upfront), running the BOSH nats release.

You can access the cf-operator logs by following the operator pod's output:

kubectl logs -f -n cf-operator cf-operator

Or look at the k8s event log:

kubectl get events -n cf-operator --watch

For now deployments have to be in the namespace the operator is running in.

Development and Tests

For more information about the operator development, see docs/development.md

For more information about testing, see docs/testing.md

For more information about building the operator from source, see docs/building.md

Directories

Path Synopsis
cmd
container-run
cmd
pkg/containerrun/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
e2e
integration
pkg
bosh/converter/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
bosh/manifest
Package manifest represents a valid BOSH manifest and provides funcs to load it, marshal it and access its fields.
Package manifest represents a valid BOSH manifest and provides funcs to load it, marshal it and access its fields.
bosh/manifest/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
credsgen/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
kube/client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
kube/client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
kube/client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
kube/client/clientset/versioned/typed/boshdeployment/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
kube/client/clientset/versioned/typed/boshdeployment/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
kube/client/clientset/versioned/typed/extendedjob/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
kube/client/clientset/versioned/typed/extendedjob/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
kube/client/clientset/versioned/typed/extendedsecret/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
kube/client/clientset/versioned/typed/extendedsecret/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
kube/client/clientset/versioned/typed/extendedstatefulset/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
kube/client/clientset/versioned/typed/extendedstatefulset/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
kube/controllers/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
kube/util/ctxlog
Package ctxlog extends ctxlog with events
Package ctxlog extends ctxlog with events
Package testing contains methods to create test data.
Package testing contains methods to create test data.
boshmanifest
Package boshmanifest contains text assets for BOSH manifests and ops files
Package boshmanifest contains text assets for BOSH manifests and ops files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL