https://github.com/martin-helmich/kubernetes-operator-example
Example Operator for Kubernetes using the Operator SDK
https://github.com/martin-helmich/kubernetes-operator-example
example golang kubernetes kubernetes-operator
Last synced: 10 months ago
JSON representation
Example Operator for Kubernetes using the Operator SDK
- Host: GitHub
- URL: https://github.com/martin-helmich/kubernetes-operator-example
- Owner: martin-helmich
- License: apache-2.0
- Created: 2019-03-17T13:46:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T15:40:36.000Z (almost 7 years ago)
- Last Synced: 2025-02-03T06:38:03.572Z (12 months ago)
- Topics: example, golang, kubernetes, kubernetes-operator
- Language: Go
- Size: 28.4 MB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# "HelloWorld" Kubernetes Operator example
This is an example Kubernetes Operator, using the [Operator Framework](https://github.com/operator-framework).
## Building
To build this project, you'll need the [Operator SDK](https://github.com/operator-framework/operator-sdk) installed on your local machine.
With the SDK installed, build the operator as follows:
```console
> operator-sdk build $DOCKER_IMAGE
```
## Running locally
Make sure you have a local Kubernetes cluster running for this (or a remote one suitable for testing purposes).
Then execute:
```console
> operator-sdk up local --namespace=$NAMESPACE # default ns is "default"
```
## Installing in a cluster
### Manually
1. Start by creating the CRD:
```console
> kubectl apply -f deploy/crds/example_v1alpha1_helloworld_crd.yaml
```
2. Then, deploy the operator:
```
> kubectl apply -f deploy
```
3. Finish off by creating a `HelloWorld` custom resource:
```console
> kubectl apply -f deploy/crds/example_v1alpha1_helloworld_cr.yaml
### Using the Operator Lifecycle Manager
Coming soon