-
Notifications
You must be signed in to change notification settings - Fork 160
Kubernetes Operator for Nessie #7967
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
Open
adutra
wants to merge
1
commit into
projectnessie:main
Choose a base branch
from
adutra:kubernetes-operator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
|
||
VERSION ?= $(shell cat ../version.txt | sed -e 's/.*-SNAPSHOT/latest/g') | ||
RELEASE_VERSION ?= $(shell cat ../version.txt | sed -e 's/-SNAPSHOT//g') | ||
|
||
# CHANNELS define the bundle channels used in the bundle. | ||
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") | ||
# To re-generate a bundle for other specific channels without changing the standard setup, you can: | ||
# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=candidate,fast,stable) | ||
# - use environment variables to overwrite this value (e.g export CHANNELS="candidate,fast,stable") | ||
ifneq ($(origin CHANNELS), undefined) | ||
BUNDLE_CHANNELS := --channels=$(CHANNELS) | ||
endif | ||
|
||
# DEFAULT_CHANNEL defines the default channel used in the bundle. | ||
# Add a new line here if you would like to change its default config. (E.g DEFAULT_CHANNEL = "stable") | ||
# To re-generate a bundle for any other default channel without changing the default setup, you can: | ||
# - use the DEFAULT_CHANNEL as arg of the bundle target (e.g make bundle DEFAULT_CHANNEL=stable) | ||
# - use environment variables to overwrite this value (e.g export DEFAULT_CHANNEL="stable") | ||
ifneq ($(origin DEFAULT_CHANNEL), undefined) | ||
BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL) | ||
endif | ||
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) | ||
|
||
# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images. | ||
# This variable is used to construct full image tags for bundle and catalog images. | ||
IMAGE_TAG_BASE ?= ghcr.io/projectnessie/nessie-operator | ||
|
||
# BUNDLE_IMG defines the image:tag used for the bundle. | ||
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>) | ||
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:$(VERSION) | ||
|
||
# Image URL to use all building/pushing image targets | ||
IMG ?= $(IMAGE_TAG_BASE):$(VERSION) | ||
|
||
PULL_POLICY ?= $(shell [ "$(VERSION)" = "latest" ] && echo "Always" || echo "IfNotPresent") | ||
PLATFORM ?= linux/$(shell arch) | ||
|
||
all: docker-build | ||
|
||
##@ General | ||
|
||
# The help target prints out all targets with their descriptions organized | ||
# beneath their categories. The categories are represented by '##@' and the | ||
# target descriptions by '##'. The awk commands is responsible for reading the | ||
# entire set of makefiles included in this invocation, looking for lines of the | ||
# file as xyz: ## something, and then pretty-format the target and help. Then, | ||
# if there's a line with ##@ something, that gets pretty-printed as a category. | ||
# More info on the usage of ANSI control characters for terminal formatting: | ||
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters | ||
# More info on the awk command: | ||
# http://linuxcommand.org/lc3_adv_awk.php | ||
|
||
help: ## Display this help. | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
##@ Build | ||
|
||
docker-build: ## Build docker image with the manager. | ||
../gradlew :nessie-operator:spotlessApply :nessie-operator:clean :nessie-operator:build -x check \ | ||
-Dquarkus.container-image.build=true \ | ||
-Dquarkus.container-image.image=${IMG} \ | ||
-Dquarkus.jib.platforms=${PLATFORM} \ | ||
-Dquarkus.kubernetes.prometheus.generate-service-monitor=false \ | ||
-Dquarkus.kubernetes.image-pull-policy=${PULL_POLICY} | ||
|
||
docker-push: ## Build and push docker image with the manager. | ||
../gradlew :nessie-operator:spotlessApply :nessie-operator:clean :nessie-operator:build -x check \ | ||
-Dquarkus.container-image.build=true \ | ||
-Dquarkus.container-image.push=true \ | ||
-Dquarkus.container-image.image=${IMG} \ | ||
-Dquarkus.jib.platforms=${PLATFORM} \ | ||
-Dquarkus.kubernetes.prometheus.generate-service-monitor=false \ | ||
-Dquarkus.kubernetes.image-pull-policy=${PULL_POLICY} | ||
|
||
##@ Deployment | ||
|
||
install: ## Install CRDs into the K8s cluster specified in ~/.kube/config. | ||
@$(foreach file, $(wildcard build/kubernetes/*-v1.yml), kubectl apply -f $(file);) | ||
|
||
uninstall: ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. | ||
@$(foreach file, $(wildcard build/kubernetes/*-v1.yml), kubectl delete -f $(file);) | ||
|
||
deploy: ## Deploy controller to the K8s cluster specified in ~/.kube/config. | ||
kubectl apply -f build/kubernetes/kubernetes.yml | ||
|
||
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. | ||
kubectl delete -f build/kubernetes/kubernetes.yml | ||
|
||
##@ Helm | ||
|
||
helm-install: ## Install CRDs and the operator using Helm. | ||
helm install nessie-operator build/helm -n nessie-operator | ||
|
||
helm-upgrade: ## Upgrade CRDs and the operator using Helm. | ||
helm upgrade nessie-operator build/helm -n nessie-operator | ||
|
||
helm-uninstall: ## Uninstall CRDs and the operator using Helm. | ||
helm uninstall nessie-operator -n nessie-operator | ||
|
||
##@ Bundle | ||
|
||
.PHONY: bundle | ||
bundle: ## Generate bundle manifests and metadata, then validate generated files. | ||
cat build/kubernetes/* | operator-sdk generate bundle -q --overwrite --version $(RELEASE_VERSION) $(BUNDLE_METADATA_OPTS) | ||
operator-sdk bundle validate ./bundle | ||
# TODO use quarkus | ||
|
||
.PHONY: bundle-build | ||
bundle-build: ## Build the bundle image. | ||
docker build -f build/bundle/nessie-operator/bundle.Dockerfile -t $(BUNDLE_IMG) build/bundle/nessie-operator | ||
|
||
.PHONY: bundle-push | ||
bundle-push: ## Push the bundle image. | ||
docker push $(BUNDLE_IMG) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Code generated by tool. DO NOT EDIT. | ||
# This file is used to track the info used to scaffold your project | ||
# and allow the plugins properly work. | ||
# More info: https://book.kubebuilder.io/reference/project-config.html | ||
domain: projectnessie.org | ||
layout: | ||
- quarkus.javaoperatorsdk.io/v1-alpha | ||
projectName: nessie-operator | ||
resources: | ||
- api: | ||
crdVersion: v1 | ||
namespaced: true | ||
domain: projectnessie.org | ||
group: nessie | ||
kind: Nessie | ||
version: v1alpha1 | ||
version: "3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Kubernetes Operator for Nessie | ||
|
||
This module is a Kubernetes Operator for Nessie. | ||
|
||
**WARNING: This is a work in progress and is not ready for production use.** | ||
|
||
The operator is designed to manage the lifecycle of Nessie instances in a Kubernetes cluster. | ||
|
||
This project was bootstrapped using [Operator SDK]: | ||
|
||
```bash | ||
operator-sdk init --plugins=quarkus --domain=projectnessie.org --project-name=nessie-operator | ||
operator-sdk create api --plugins=quarkus --group nessie --version=v1alpha1 --kind=Nessie | ||
``` | ||
|
||
[Operator SDK]:https://sdk.operatorframework.io/docs/cli/operator-sdk/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.