diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 6d78bc9..8642683 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -102,6 +102,19 @@ jobs: echo "Info: Installing prometheus setup" kubectl apply -f setup --server-side + echo "Info: Waiting for Prometheus CRDs to be established..." + kubectl wait --for=condition=Established --timeout=120s \ + customresourcedefinitions.apiextensions.k8s.io/alertmanagerconfigs.monitoring.coreos.com \ + customresourcedefinitions.apiextensions.k8s.io/alertmanagers.monitoring.coreos.com \ + customresourcedefinitions.apiextensions.k8s.io/podmonitors.monitoring.coreos.com \ + customresourcedefinitions.apiextensions.k8s.io/probes.monitoring.coreos.com \ + customresourcedefinitions.apiextensions.k8s.io/prometheuses.monitoring.coreos.com \ + customresourcedefinitions.apiextensions.k8s.io/prometheusagents.monitoring.coreos.com \ + customresourcedefinitions.apiextensions.k8s.io/prometheusrules.monitoring.coreos.com \ + customresourcedefinitions.apiextensions.k8s.io/scrapeconfigs.monitoring.coreos.com \ + customresourcedefinitions.apiextensions.k8s.io/servicemonitors.monitoring.coreos.com \ + customresourcedefinitions.apiextensions.k8s.io/thanosrulers.monitoring.coreos.com + echo "Info: Installing prometheus manifests" kubectl apply -f . --server-side diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c6e3813 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,160 @@ +# Contributing to Kruize Operator + +Thank you for your interest in the Kruize Operator! We welcome your contributions to the project. + +## Submitting a Contribution + +The Kruize Operator is [Apache 2.0](https://github.com/kruize/kruize-operator/blob/main/LICENSE) licensed and uses GitHub to manage reviews of pull requests. This document outlines the contribution workflow, commit message formatting, contact details and other resources to make it easier to get your contribution accepted. + +### Contribution Workflow + +These steps outline the general contribution workflow: + +- Fork and set up the [kruize-operator](https://github.com/kruize/kruize-operator) repository on your workstation +- Create a topic branch based off the `mvp_demo` branch +- Follow the coding guidelines while making code changes +- Install the required software to build and deploy the operator (see [Prerequisites](#prerequisites)) +- Make sure the tests pass, and add any new tests if appropriate (see [Testing](#testing)) +- Make commits of logical units +- Make sure your commit messages are in the proper format (see [Commit Message](#commit-message)) +- Push your changes to a topic branch in your fork of the repository +- Submit a pull request to the original repository +- Ensure the PR checks pass (see [PR Checks](#pr-checks)) +- For any queries, open a [GitHub Discussion](https://github.com/kruize/kruize-operator/discussions) or an [issue](https://github.com/kruize/kruize-operator/issues) + +If this is your first pull request on GitHub, click [here](https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/) to quickly get started. + +--- + +## Prerequisites + +See the [Prerequisites section in README.md](README.md#prerequisites) for the full list of required tools and versions. + +--- + +## Building + +```sh +# Generate code and manifests +make generate manifests + +# Build the operator image +make docker-build IMG=/kruize-operator:tag + +# Build and push +make docker-build docker-push IMG=/kruize-operator:tag +``` + +For a streamlined build and push workflow with prerequisite checks and version management, use the provided script: + +```sh +./scripts/operator_build_and_push.sh -o -b +``` + +--- + +## Testing + +Before submitting a pull request, ensure all tests pass: + +```sh +# Run unit tests +make test + +# Run end-to-end tests (requires a running cluster) +make test-e2e +``` + +See [test/Operator_tests.md](test/Operator_tests.md) for detailed testing documentation. + +--- + +## PR Checks + +All pull requests are subject to automated checks defined in [`.github/workflows/pr-check.yaml`](.github/workflows/pr-check.yaml). Ensure: + +- Unit tests pass (`make test`) +- Code compiles without errors (`make build` or `make generate manifests`) +- No linting errors + +--- + +## Commit Message + +We use GPG keys for signing commits. Refer to [Generating a new GPG key](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key) for details. + +The commit message should indicate **what** has changed and **why** the change was made. Sign off on your commit in the footer. By doing this, you assert original authorship of the commit and that you are permitted to contribute it. + +This can be automatically added to your commit by passing `-S` (GPG sign) and `-s` (sign-off) to `git commit`: + +```sh +git commit -S -s -m "your commit message" +``` + +Or by manually adding the following line to the footer of the commit: + +``` +Signed-off-by: Full Name +``` + +### Commit Message Format + +``` +: + + + +Signed-off-by: Full Name +``` + +**Types:** `fix`, `feat`, `docs`, `refactor`, `test`, `chore`, `ci` + +**Examples:** + +``` +fix: correct finalizer cleanup timeout handling + +The finalizer was not respecting the FINALIZER_TIMEOUT_SECONDS env var +during resource deletion, causing indefinite hangs on slow clusters. + +Signed-off-by: Jane Doe +``` + +``` +feat: add support for KIND cluster overlay + +Signed-off-by: John Smith +``` + +--- + +## Code Style and Guidelines + +- Follow standard [Go conventions](https://google.github.io/styleguide/go/) +- Run `gofmt` before committing: `gofmt -w ./...` +- Keep changes focused — one logical change per commit and per PR +- Add or update documentation in `docs/` for non-trivial changes +- Do not hardcode secrets, image digests, or environment-specific values + +--- + +## Reporting Issues + +If you find a bug or want to request a feature, please [open an issue](https://github.com/kruize/kruize-operator/issues/new) with: + +- A clear description of the problem or request +- Steps to reproduce (for bugs) +- The Kubernetes/OpenShift version and cluster type (Minikube, KIND, OpenShift) +- Relevant logs or error messages + +--- + +## Additional Resources + +- [Kruize Operator README](README.md) +- [Operator SDK Documentation](https://sdk.operatorframework.io/) +- [Operator Lifecycle Manager](https://github.com/operator-framework/operator-lifecycle-manager) + +--- + +Thank you for contributing! diff --git a/Makefile b/Makefile index 281807b..eb2ef30 100755 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.5) # - use environment variables to overwrite this value (e.g export VERSION=0.0.5) -VERSION ?= 0.0.7 +VERSION ?= 0.0.8 # 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") diff --git a/README.md b/README.md index 22e822e..af089c3 100755 --- a/README.md +++ b/README.md @@ -207,6 +207,15 @@ This requires a Kubernetes or OpenShift cluster. Recommended: Minikube, KIND, or **For detailed testing documentation**, see: - [Operator Tests Documentation](test/Operator_tests.md) +## Contributing + +We welcome your contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for more details. + +Join the [Kruize Slack](http://kruizeworkspace.slack.com/) to connect with the community, ask questions, and collaborate! + +or Scan the QR Code +![Slack QR code](docs/images/kruize_slack_QR.jpeg) + ## License Apache License 2.0, see [LICENSE](/LICENSE). diff --git a/bundle/manifests/kruize-operator.clusterserviceversion.yaml b/bundle/manifests/kruize-operator.clusterserviceversion.yaml index 71c4bd5..e283f07 100755 --- a/bundle/manifests/kruize-operator.clusterserviceversion.yaml +++ b/bundle/manifests/kruize-operator.clusterserviceversion.yaml @@ -15,7 +15,7 @@ metadata: "name": "kruize-sample" }, "spec": { - "autotune_image": "quay.io/kruize/autotune_operator:0.11", + "autotune_image": "quay.io/kruize/autotune_operator:0.12", "autotune_ui_image": "quay.io/kruize/kruize-ui:0.1.0", "cluster_type": "openshift", "kruize": { @@ -57,7 +57,7 @@ metadata: ] }, "namespace": "openshift-tuning", - "optimizer_image": "quay.io/kruize/kruize-optimizer:0.0.1", + "optimizer_image": "quay.io/kruize/kruize-optimizer:0.0.2", "persistentVolume": { "accessModes": [ "ReadWriteMany" @@ -95,14 +95,14 @@ metadata: ] capabilities: Basic Install categories: Monitoring, Developer Tools - containerImage: quay.io/kruize/kruize-operator:0.0.7 - createdAt: "2026-07-03T11:55:58Z" + containerImage: quay.io/kruize/kruize-operator:0.0.8 + createdAt: "2026-11-09T10:58:16Z" description: Resource optimization tool for Kubernetes workloads operators.operatorframework.io/builder: operator-sdk-v1.42.2 operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 repository: https://github.com/kruize/kruize-operator support: Kruize Community - name: kruize-operator.v0.0.7 + name: kruize-operator.v0.0.8 namespace: placeholder spec: apiservicedefinitions: {} @@ -523,7 +523,7 @@ spec: - --metrics-bind-address=:8443 command: - /app/manager - image: quay.io/kruize/kruize-operator:0.0.7 + image: quay.io/kruize/kruize-operator:0.0.8 livenessProbe: httpGet: path: /healthz @@ -627,4 +627,4 @@ spec: minKubeVersion: 1.23.0 provider: name: Kruize - version: 0.0.7 + version: 0.0.8 diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 8206725..22a142a 100755 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -5,4 +5,4 @@ kind: Kustomization images: - name: controller newName: quay.io/kruize/kruize-operator - newTag: 0.0.7 + newTag: 0.0.8 diff --git a/config/manifests/bases/kruize-operator.clusterserviceversion.yaml b/config/manifests/bases/kruize-operator.clusterserviceversion.yaml index 2e127bd..19ce71a 100644 --- a/config/manifests/bases/kruize-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/kruize-operator.clusterserviceversion.yaml @@ -5,7 +5,7 @@ metadata: alm-examples: '[]' capabilities: Basic Install categories: Monitoring, Developer Tools - containerImage: quay.io/kruize/kruize-operator:0.0.7 + containerImage: quay.io/kruize/kruize-operator:0.0.8 description: Resource optimization tool for Kubernetes workloads operators.operatorframework.io/builder: operator-sdk-v1.42.2 operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 diff --git a/config/samples/v1alpha1_kruize.yaml b/config/samples/v1alpha1_kruize.yaml index a1a365b..146776e 100644 --- a/config/samples/v1alpha1_kruize.yaml +++ b/config/samples/v1alpha1_kruize.yaml @@ -8,9 +8,9 @@ metadata: spec: # Supported values: "openshift", "minikube", "kind" cluster_type: "openshift" - autotune_image: "quay.io/kruize/autotune_operator:0.11" + autotune_image: "quay.io/kruize/autotune_operator:0.12" autotune_ui_image: "quay.io/kruize/kruize-ui:0.1.0" - optimizer_image: "quay.io/kruize/kruize-optimizer:0.0.1" + optimizer_image: "quay.io/kruize/kruize-optimizer:0.0.2" # For OpenShift, use: "openshift-tuning", Minikube/KIND, use: "monitoring" namespace: "openshift-tuning" diff --git a/docs/images/kruize_slack_QR.jpeg b/docs/images/kruize_slack_QR.jpeg new file mode 100644 index 0000000..8fed484 Binary files /dev/null and b/docs/images/kruize_slack_QR.jpeg differ diff --git a/internal/constants/kruize_images.go b/internal/constants/kruize_images.go index fda3821..1154e83 100644 --- a/internal/constants/kruize_images.go +++ b/internal/constants/kruize_images.go @@ -33,13 +33,13 @@ const ( // Default container image versions const ( // defaultAutotuneImageTag is the default tag for Kruize Autotune image - defaultAutotuneImageTag = "0.11" + defaultAutotuneImageTag = "0.12" // defaultUIImageTag is the default tag for Kruize UI image defaultUIImageTag = "0.1.0" // defaultOptimizerImageTag is the default tag for Kruize Optimizer image - defaultOptimizerImageTag = "0.0.1" + defaultOptimizerImageTag = "0.0.2" // defaultAutotuneImageRepo is the default repository for Kruize Autotune image defaultAutotuneImageRepo = "quay.io/kruize/autotune_operator"