Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
Operator deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentluce committed Oct 18, 2024
1 parent a518a9f commit 7bf6577
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
cancel-in-progress: true

jobs:
build-publish-demo:
build-publish-artifacts:
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main'
steps:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ CONTAINER_TOOL ?= docker
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

# Kardinal Operator
IMG ?= kurtosistech/kardinal-operator:latest

.PHONY: all
all: build

Expand Down
51 changes: 33 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,57 @@

Implementation of [Kardinal](https://github.com/kurtosis-tech/kardinal) as a K8S Operator.

## Development

Minikube + K8S manifest deployed. K8S context set to your local cluster.
```
make install (to install the CRDs into the cluster)
```
## Install

The following three commands are commonly used during development:
The Kardinal Operator is built using Kubebuilder. Run the following commands to install the CRDs and the operator in the cluster pointed by your kubeconfig.

```
make lint (Run golangci linter. Can also be configured inside your IDE.)
make test (Run tests against local cluster)
make run (Run operator against your local cluster)
make deploy
```

Manage custom resources with kubectl:
## CRDs

### Flows

```yaml
apiVersion: core.kardinal.dev/v1
kind: Flow
metadata:
labels:
app.kubernetes.io/name: kardinal
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/managed-by: kardinal-operator
name: flow-test
namespace: baseline
spec:
service: frontend
image: kurtosistech/frontend:demo-frontend
```
## Uninstall
Run the following commands to uninstall the CRDs and the operator in the cluster pointed by your kubeconfig.
```
make undeploy
```

## Development

Minikube + K8S manifest deployed. K8S context set to your local cluster.
```
make install (to install the CRDs into the cluster)
```

The following three commands are commonly used during development:

```
make lint (Run golangci linter. Can also be configured inside your IDE.)
make test (Run tests against local cluster)
make run (Run operator against your local cluster)
```

Manage custom resources with kubectl:

```
# Create a flow
kubectl create -f ./ci/flow-test.yaml
Expand All @@ -47,11 +67,6 @@ kubectl get flows -n baseline
kubectl describe flows flow-test -n baseline
```

Deploy the operator inside the cluster
```
make deploy (when you want to test it inside the cluster)
```

## Update the CRDs API

1. Read [this document][api-design-doc] to follow the design rules.
Expand All @@ -73,4 +88,4 @@ make deploy (when you want to test it inside the cluster)
4. NOTE: If you receive an error, please run the specified command in the error and re-run make manifests.

[api-design-doc]: https://book.kubebuilder.io/cronjob-tutorial/api-design
[rbac-markers-doc]: https://book.kubebuilder.io/reference/markers/rbac
[rbac-markers-doc]: https://book.kubebuilder.io/reference/markers/rbac
6 changes: 6 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
resources:
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: controller
newTag: latest

0 comments on commit 7bf6577

Please sign in to comment.