Skip to content

Commit

Permalink
Merge branch 'master' into ingestion
Browse files Browse the repository at this point in the history
  • Loading branch information
AdheipSingh authored Feb 15, 2024
2 parents 84e5926 + 27600b6 commit 1f9d8fc
Show file tree
Hide file tree
Showing 62 changed files with 8,899 additions and 2,173 deletions.
10 changes: 8 additions & 2 deletions ADOPTERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This is a list of production adopters of Druid Operator:

| Company | Industry |
| :--- |:----------------------------------|
|[Dailymotion](https://dailymotion.com/)| Video streaming, Adtech |
|[AppsFlyer](https://www.appsflyer.com/)| Mobile Marketing Software, Adtech |

Open Source Solutions based on Druid Operator:
| Company | Industry |
| :--- | :--- |
|[Dailymotion](https://dailymotion.com/)|Video streaming, Adtech|
| :--- |:----------------------------------|
|[AWS](https://github.com/aws-solutions/scalable-analytics-using-apache-druid-on-aws)|
7 changes: 6 additions & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Maintainers for the druid operator project.

- [Adheip Singh](https://github.com/AdheipSingh)
- [Nitish Tiwari](https://github.com/nitisht)

# Collaborators for the druid operator project

- [Itamar Marom](https://github.com/itamar-marom)
- [Cyril Corbon](https://github.com/cyril-corbon)

131 changes: 67 additions & 64 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ IMG ?= "datainfrahq/druid-operator"
# Local Image URL to be pushed to kind registery
IMG_KIND ?= "localhost:5001/druid-operator"
# NAMESPACE for druid operator e2e
NAMESPACE_DRUID_OPERATOR ?= "druid-operator"
NAMESPACE_DRUID_OPERATOR ?= "druid-operator-system"
# NAMESPACE for zk operator e2e
NAMESPACE_ZK_OPERATOR ?= "zk-operator"
# NAMESPACE for zk operator e2e
Expand Down Expand Up @@ -51,6 +51,10 @@ help: ## Display this help.

##@ Development

.PHONY: kind
kind: ## Bootstrap Kind Locally
sh e2e/kind.sh

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) crd:generateEmbeddedObjectMeta=true rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
Expand All @@ -68,10 +72,51 @@ fmt: ## Run go fmt against code.
vet: ## Run go vet against code.
go vet ./...

##@ Test
.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out

.PHONY: e2e
e2e: ## Runs e2e tests
e2e/e2e.sh

.PHONY: docker-build-local-test
docker-build-local-test: ## Build docker image with the manager for test on kind.
docker build -t ${IMG_KIND}:${TEST_IMG_TAG} -f e2e/Dockerfile-testpod .

.PHONY: docker-push-local-test
docker-push-local-test: ## Push docker image with the manager to kind registry.
docker push ${IMG_KIND}:${TEST_IMG_TAG}

.PHONY: deploy-testjob
deploy-testjob: ## Run a wikipedia test pod
kubectl create job wiki-test --image=${IMG_KIND}:${TEST_IMG_TAG} -- sh /wikipedia-test.sh
bash e2e/monitor-task.sh

.PHONY: helm-install-druid-operator
helm-install-druid-operator: ## Helm install to deploy the druid operator
helm upgrade --install \
--namespace ${NAMESPACE_DRUID_OPERATOR} \
--create-namespace \
${NAMESPACE_DRUID_OPERATOR} chart/ \
--set image.repository=${IMG_KIND} \
--set image.tag=${IMG_TAG}

.PHONY: helm-minio-install
helm-minio-install: ## Helm deploy minio operator and minio
helm repo add minio https://operator.min.io/
helm repo update minio
helm upgrade --install \
--namespace ${NAMESPACE_MINIO_OPERATOR} \
--create-namespace \
${NAMESPACE_MINIO_OPERATOR} minio/operator \
-f e2e/configs/minio-operator-override.yaml
helm upgrade --install \
--namespace ${NAMESPACE_DRUID} \
--create-namespace \
${NAMESPACE_DRUID}-minio minio/tenant \
-f e2e/configs/minio-tenant-override.yaml

##@ Build

Expand All @@ -94,6 +139,14 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
docker push ${IMG}:${IMG_TAG}

.PHONY: docker-build-local
docker-build-local: ## Build docker image with the manager for kind registry.
docker build -t ${IMG_KIND}:${IMG_TAG} .

.PHONY: docker-push-local
docker-push-local: ## Push docker image with the manager to kind registry.
docker push ${IMG_KIND}:${IMG_TAG}

# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
Expand All @@ -119,7 +172,7 @@ endif

.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply -f -
$(KUSTOMIZE) build config/crd | kubectl apply --server-side -f -

.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
Expand All @@ -128,7 +181,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}:${IMG_TAG}
$(KUSTOMIZE) build config/default | kubectl apply -f -
$(KUSTOMIZE) build config/default | kubectl apply --server-side -f -

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
Expand All @@ -147,6 +200,11 @@ helm-lint: ## Lint Helm chart.
helm-template: ## Run Helm template.
helm -n druid-operator-system template --create-namespace ${NAMESPACE_DRUID_OPERATOR} ./chart --debug

##@ Documentation

.PHONY: api-docs
api-docs: gen-crd-api-reference-docs ## Generate API reference documentation
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir=./apis/druid/v1alpha1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api_specifications/druid.md

##@ Build Dependencies

Expand All @@ -158,11 +216,13 @@ $(LOCALBIN):
## Tool Binaries
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
GEN_CRD_API_REFERENCE_DOCS = $(LOCALBIN)/gen-crd-api-reference-docs
ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.11.2
GEN_CRD_API_REF_VERSION ?= v0.3.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -185,64 +245,7 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

## e2e deployment
.PHONY: e2e
e2e: ## Runs e2e tests
e2e/e2e.sh

## Build Kind
.PHONY: kind
kind: ## Bootstrap Kind Locally
sh e2e/kind.sh

## Make Docker build for kind registery
.PHONY: docker-build-local
docker-build-local: ## Build docker image with the manager.
docker build -t ${IMG_KIND}:${IMG_TAG} .

## Make Docker push locally to kind registery
.PHONY: docker-push-local
docker-push-local: ## Build docker image with the manager.
docker push ${IMG_KIND}:${IMG_TAG}

## Make Docker build for test image
.PHONY: docker-build-local-test
docker-build-local-test: ## Build docker image with the manager.
docker build -t ${IMG_KIND}:${TEST_IMG_TAG} -f e2e/Dockerfile-testpod .

## Make Docker push locally to kind registery
.PHONY: docker-push-local-test
docker-push-local-test: ## Build docker image with the manager.
docker push ${IMG_KIND}:${TEST_IMG_TAG}

## Helm install to deploy the druid operator
.PHONY: helm-install-druid-operator
helm-install-druid-operator: ## helm upgrade/install
helm upgrade --install \
--namespace ${NAMESPACE_DRUID_OPERATOR} \
--create-namespace \
${NAMESPACE_DRUID_OPERATOR} chart/ \
--set image.repository=${IMG_KIND} \
--set image.tag=${IMG_TAG}

## Helm deploy minio operator and minio
.PHONY: helm-minio-install
helm-minio-install:
helm repo add minio https://operator.min.io/
helm repo update minio
helm upgrade --install \
--namespace ${NAMESPACE_MINIO_OPERATOR} \
--create-namespace \
${NAMESPACE_MINIO_OPERATOR} minio/operator \
-f e2e/configs/minio-operator-override.yaml
helm upgrade --install \
--namespace ${NAMESPACE_DRUID} \
--create-namespace \
${NAMESPACE_DRUID}-minio minio/tenant \
-f e2e/configs/minio-tenant-override.yaml

## Run the test pod
.PHONY: deploy-testjob
deploy-testjob:
kubectl create job wiki-test --image=${IMG_KIND}:${TEST_IMG_TAG} -- sh /wikipedia-test.sh
bash e2e/monitor-task.sh
.PHONY: gen-crd-api-reference-docs
gen-crd-api-reference-docs: $(GEN_CRD_API_REFERENCE_DOCS)
$(GEN_CRD_API_REFERENCE_DOCS): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install github.com/ahmetb/gen-crd-api-reference-docs@$(GEN_CRD_API_REF_VERSION)
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
<h2 align="center">
<picture>
<img alt="DataInfra Logo" src="https://raw.githubusercontent.com/datainfrahq/.github/main/images/logo.svg">
<img alt="DataInfra Logo" src="https://raw.githubusercontent.com/datainfrahq/.github/main/images/druid-operator.png"width="200" height="200">
</picture>
<br>
Kubernetes Operator For Apache Druid
</h2>

**This is the official [druid-operator](https://github.com/druid-io/druid-operator) project, now maintained by [Maintainers.md](./MAINTAINERS.md).
[druid-operator](https://github.com/druid-io/druid-operator) is depreacted. Ref to [issue](https://github.com/druid-io/druid-operator/issues/329) and [PR](https://github.com/druid-io/druid-operator/pull/336). Feel free to open issues and PRs! Collaborators are welcome !**

<div align="center">

![Build Status](https://github.com/datainfrahq/druid-operator/actions/workflows/docker-image.yml/badge.svg) ![Docker pull](https://img.shields.io/docker/pulls/datainfrahq/druid-operator.svg) [![Latest Version](https://img.shields.io/github/tag/datainfrahq/druid-operator)](https://github.com/datainfrahq/druid-operator/releases) [![Slack](https://img.shields.io/badge/slack-brightgreen.svg?logo=slack&label=Community&style=flat&color=%2373DC8C&)](https://kubernetes.slack.com/archives/C04F4M6HT2L)

</div>

- Druid Operator provisions and manages [Apache Druid](https://druid.apache.org/) cluster on kubernetes.
- Druid Operator is designed to provision and manage [Apache Druid](https://druid.apache.org/) in distributed mode only.
- It is built in Golang using [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder).
- Refer to [Documentation](./docs/README.md) for getting started.
- Feel free to join Kubernetes slack and join [druid-operator](https://kubernetes.slack.com/archives/C04F4M6HT2L)

</div>

Druid Operator provisions and manages [Apache Druid](https://druid.apache.org/) cluster on kubernetes. Druid Operator is designed to provision and manage [Apache Druid](https://druid.apache.org/) in distributed mode only. It is built using the [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder). Language used is GoLang. Druid Operator is available on [operatorhub.io](https://operatorhub.io/operator/druid-operator) Refer to [Documentation](./docs/README.md) for getting started. Join Kubernetes slack and join [druid-operator](https://kubernetes.slack.com/archives/C04F4M6HT2L)
### Newsletter - Monthly updates on running druid on kubernetes.
- [Apache Druid on Kubernetes](https://druidonk8s.substack.com/)

### Talks and Blogs on Druid Operator

- [Druid Summit 2023](https://druidsummit.org/agenda?agendaPath=session/1256850)
- [Dok Community](https://www.youtube.com/live/X4A3lWJRGHk?feature=share)
- [Druid Summit](https://youtu.be/UqPrttXRBDg)
- [Druid Operator Blog](https://www.cloudnatively.com/apache-druid-on-kubernetes/)
- [Druid On K8s Without ZK](https://youtu.be/TRYOvkz5Wuw)
- [Building Apache Druid on Kubernetes: How Dailymotion Serves Partner Data](https://youtu.be/FYFq-tGJOQk)

### Supported CR

Expand All @@ -36,27 +41,25 @@

### Notifications

- The project moved to <b>Kubebuilder v3</b> which requires a [manual change](docs/kubebuilder_v3_migration.md) in the operator.
- Users may experience HPA issues with druid-operator with release 0.0.5, as described in the [issue](https://github.com/druid-io/druid-operator/issues/160).
- The latest release 0.0.6 has fixes for the above issue.
- The operator has moved from HPA apiVersion autoscaling/v2beta1 to autoscaling/v2 API users will need to update there HPA Specs according v2beta2 api in order to work with the latest druid-operator release.
- Users may experience pvc deletion [issue](https://github.com/druid-io/druid-operator/issues/186) in release 0.0.6, this issue has been fixed in patch release 0.0.6.1.
- The project moved to <b>Kubebuilder v3</b> which requires a [manual change](docs/kubebuilder_v3_migration.md) in the operator.
- Users are encourage to use operator version 0.0.9+.
- The operator has moved from HPA apiVersion autoscaling/v2beta1 to autoscaling/v2 API users will need to update there HPA Specs according v2 api in order to work with the latest druid-operator release.
- druid-operator has moved Ingress apiVersion networking/v1beta1 to networking/v1. Users will need to update there Ingress Spec in the druid CR according networking/v1 syntax. In case users are using schema validated CRD, the CRD will also be needed to be updated.
- druid-operator has moved PodDisruptionBudget apiVersion policy/v1beta1 to policy/v1. Users will need to update there Kubernetes versions to 1.21+ to use druid-operator tag 0.0.9+.
- The latest release for druid-operator is v1.0.0, this release is compatible with k8s version 1.25. HPA API is kept to version v2beta2.
- The v1.0.0 release for druid-operator is compatible with k8s version 1.25. HPA API is kept to version v2beta2.
- Release v1.2.2 had a bug for namespace scoped operator deployments, this is fixed in 1.2.3.

### Kubernetes version compatibility

| druid-operator | 0.0.9 | v1.0.0 | v1.1.0 |
| :------------- | :-------------: | :-----: | :---: |
| kubernetes <= 1.20 | :x:| :x: | :x: |
| kubernetes == 1.21 | :white_check_mark:| :x: | :x: |
| kubernetes >= 1.22 and < 1.25 | :white_check_mark: | :white_check_mark: | :x: |
| kubernetes > 1.25 | :x: | :x: | :white_check_mark: |
| druid-operator | 0.0.9 | v1.0.0 | v1.1.0 | v1.2.2 | v1.2.3 |
| :------------- | :-------------: | :-----: | :---: | :---: | :---: |
| kubernetes <= 1.20 | :x:| :x: | :x: | :x: | :x: |
| kubernetes == 1.21 | :white_check_mark:| :x: | :x: | :x: | :x: |
| kubernetes >= 1.22 and <= 1.25 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| kubernetes > 1.25 and <= 1.29.1 | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: |

### Contributors

<a href="https://github.com/datainfrahq/druid-operator/graphs/contributors"><img src="https://contrib.rocks/image?repo=datainfrahq/druid-operator" /></a>
<a href="https://github.com/datainfrahq/druid-operator/graphs/contributors"><img src="https://contrib.rocks/image?repo=datainfrahq/druid-operator"/></a>

### Note
Apache®, [Apache Druid, Druid®](https://druid.apache.org/) are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. This project, druid-operator, is not an Apache Software Foundation project.
3 changes: 3 additions & 0 deletions apis/druid/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// +kubebuilder:object:generate=true
// +groupName=druid.apache.org
package v1alpha1
Loading

0 comments on commit 1f9d8fc

Please sign in to comment.