Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Move policy/v1beta1 to policy/v1 for K8s 1.25+ compatability #334

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b00a9f0
Bump github.com/prometheus/client_golang from 1.11.0 to 1.11.1
dependabot[bot] Feb 15, 2023
c20a190
update license
AdheipSingh Feb 18, 2023
dab2073
update license
AdheipSingh Feb 18, 2023
cd93e36
Merge pull request #12 from AdheipSingh/master
AdheipSingh Feb 18, 2023
424c9c5
update CI
AdheipSingh Feb 18, 2023
8ac2dae
Merge pull request #13 from AdheipSingh/Fix-CI
AdheipSingh Feb 18, 2023
629dabf
update README badge
AdheipSingh Feb 18, 2023
d3de871
Merge pull request #14 from AdheipSingh/master
AdheipSingh Feb 18, 2023
a62d308
WIP e2e tests
AdheipSingh Feb 19, 2023
75146f3
update e2e with latest druid
AdheipSingh Feb 19, 2023
6cc3fec
add e2e to ci
AdheipSingh Feb 19, 2023
525799e
fix rollout
AdheipSingh Feb 19, 2023
0af89c0
hack update
AdheipSingh Feb 19, 2023
5c9dd34
fix array
AdheipSingh Feb 19, 2023
6ebab34
add e2e
AdheipSingh Feb 19, 2023
8c5dca7
update e2e
AdheipSingh Feb 19, 2023
0803f6d
fix e2e
AdheipSingh Feb 19, 2023
4f4a7f8
Merge pull request #16 from AdheipSingh/master
AdheipSingh Feb 19, 2023
4973792
make nodeSelector consistent
AdheipSingh Feb 21, 2023
d920f11
Merge pull request #18 from AdheipSingh/Fix-5-NodeSpec-Consistent
AdheipSingh Feb 21, 2023
4a4812d
Merge pull request #1 from cloudnativelyhq/dependabot/go_modules/gith…
AdheipSingh Feb 21, 2023
8883ee7
remove functional dependency on empty objects
AdheipSingh Feb 21, 2023
7171611
Merge pull request #19 from AdheipSingh/Fix-functional-Empty-Obj
AdheipSingh Feb 21, 2023
c64e9c0
Update README.md
AdheipSingh Feb 21, 2023
63e1ef6
feat: Move policy/v1beta1 to policy/v1 for K8s 1.25+ compatability
Feb 10, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Druid Operator

on:
push:
Expand All @@ -18,5 +18,5 @@ jobs:
run: make lint
- name: Run helm template
run: make template
- name: Build the Docker image
run: docker build . -t druidio/druid-operator:$(date +%s)
- name: Run e2e tests
run: make e2e
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,17 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---
Copyright 2023 Cloudnatively Services, Pvt Ltd

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
70 changes: 65 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# IMG TAG
IMG_TAG ?= "latest"
# Image URL to use all building/pushing image targets
IMG ?= "druid-operator:latest"
IMG ?= "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 for zk operator e2e
NAMESPACE_ZK_OPERATOR ?= "zk-operator"
# NAMESPACE for zk operator e2e
NAMESPACE_MINIO_OPERATOR ?= "minio-operator"
# NAMESPACE for druid app e2e
NAMESPACE_DRUID ?= "druid"

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.24.2
ENVTEST_K8S_VERSION = 1.25.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -77,11 +90,11 @@ template:

.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
docker build -t ${IMG} .
docker build -t ${IMG}:${IMG_TAG} .

.PHONY: docker-push
docker-push: ## Push docker image with the manager.
docker push ${IMG}
docker push ${IMG}:${IMG_TAG}

##@ Deployment

Expand All @@ -99,7 +112,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}
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}:${IMG_TAG}
$(KUSTOMIZE) build config/default | kubectl apply -f -

.PHONY: undeploy
Expand Down Expand Up @@ -137,3 +150,50 @@ $(CONTROLLER_GEN): $(LOCALBIN)
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:
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}

## 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

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Kubernetes Operator for Apache Druid
![Build Status](https://github.com/druid-io/druid-operator/actions/workflows/docker-image.yml/badge.svg) ![Docker pull](https://img.shields.io/docker/pulls/druidio/druid-operator.svg) [![Latest Version](https://img.shields.io/github/tag/druid-io/druid-operator)](https://github.com/druid-io/druid-operator/releases)
![Build Status](https://github.com/datainfrahq/druid-operator/actions/workflows/docker-image.yml/badge.svg) ![Docker pull](https://img.shields.io/docker/pulls/druidio/druid-operator.svg) [![Latest Version](https://img.shields.io/github/tag/druid-io/druid-operator)](https://github.com/druid-io/druid-operator/releases)

- 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.
Expand All @@ -14,11 +14,12 @@
- ```Druid``` CR belongs to api Group ```druid.apache.org``` and version ```v1alpha1```

### Notifications
- 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).
- 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/v2beta2 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.
- 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-0.0.10+.

### 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.
4 changes: 2 additions & 2 deletions apis/druid/v1alpha1/druid_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
autoscalev2beta2 "k8s.io/api/autoscaling/v2beta2"
v1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
"k8s.io/api/policy/v1beta1"
policyv1 "k8s.io/api/policy/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -208,7 +208,7 @@ type DruidNodeSpec struct {
PodLabels map[string]string `json:"podLabels,omitempty"`

// Optional
PodDisruptionBudgetSpec *v1beta1.PodDisruptionBudgetSpec `json:"podDisruptionBudgetSpec,omitempty"`
PodDisruptionBudgetSpec *policyv1.PodDisruptionBudgetSpec `json:"podDisruptionBudgetSpec,omitempty"`

// Required
RuntimeProperties string `json:"runtime.properties"`
Expand Down
4 changes: 2 additions & 2 deletions apis/druid/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading