Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
version: ${{ steps.version.outputs.version }}
values_version: ${{ steps.version.outputs.values_version }}
chart_version: ${{ steps.version.outputs.chart_version }}
catalog_version: ${{ steps.version.outputs.catalog_version }}
steps:
- name: 🛎️ Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
Expand All @@ -29,6 +30,7 @@ jobs:
echo "version=$(make print-VERSION | cut -d'=' -f2)" >> $GITHUB_OUTPUT
echo "values_version=$(yq '.deployment.image.tag' chart/values.yaml)" >> $GITHUB_OUTPUT
echo "chart_version=$(yq '.appVersion' chart/Chart.yaml)" >> $GITHUB_OUTPUT
echo "catalog_version=$(yq '.spec.image' deploy/catalog_source.yaml | cut -d':' -f2)" >> $GITHUB_OUTPUT
echo $GITHUB_OUTPUT

check:
Expand All @@ -42,6 +44,7 @@ jobs:
echo "values_version: ${{ needs.release.outputs.values_version }}"
echo "chart_version: ${{ needs.release.outputs.chart_version }}"
echo "tag_name: ${{ github.event.release.tag_name }}"
echo "catalog_version: ${{ needs.release.outputs.catalog_version }}"

if [ "${{ github.event.release.tag_name }}" != "${{ needs.release.outputs.version }}" ]; then
echo "Version in Makefile does not match release tag"
Expand All @@ -58,6 +61,11 @@ jobs:
exit 1
fi

if [ "${{ github.event.release.tag_name }}" != "${{ needs.release.outputs.catalog_version }}" ]; then
echo "Version in deploy/catalog_source.yaml does not match release tag"
exit 1
fi


build:
name: 🛠️ Build Operator images
Expand Down Expand Up @@ -88,4 +96,4 @@ jobs:
make bundle-build bundle-push
- name: 🏗️ Build and push Operator catalog
run: |
make catalog-build catalog-push
make catalog-build catalog-push
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ When adding new Custom Resource Definitions (CRDs):

```bash
# Create a new API
operator-sdk create api --group overcommit --version v1alpha1 --kind YourNewResource --resource --controller
operator-sdk create api --group overcommit --version v1alphav1 --kind YourNewResource --resource --controller
```

#### Building and Testing
Expand Down Expand Up @@ -167,7 +167,7 @@ k8s-overcommit-operator/
├── .github/ # GitHub workflows and templates
│ └── workflows/ # CI/CD pipelines
├── api/ # Kubernetes API definitions
│ └── v1alpha1/ # API version v1alpha1
│ └── v1alphav1/ # API version v1alphav1
│ ├── overcommitclass_types.go # OvercommitClass CRD definition
│ ├── overcommitclass_webhook.go # Webhook implementation
│ ├── overcommitclass_webhook_test.go # Webhook tests
Expand Down Expand Up @@ -201,7 +201,7 @@ k8s-overcommit-operator/
│ │ ├── role_binding.yaml # Role binding
│ │ └── service_account.yaml # Service account
│ ├── samples/ # Sample Custom Resources
│ │ └── overcommit_v1alpha1_overcommitclass.yaml
│ │ └── overcommit_v1alphav1_overcommitclass.yaml
│ └── webhook/ # Webhook configuration
│ ├── kustomization.yaml
│ ├── manifests.yaml
Expand Down Expand Up @@ -242,9 +242,9 @@ k8s-overcommit-operator/

### Directory Details

#### `/api/v1alpha1/`
#### `/api/v1alphav1/`

Contains the Kubernetes API definitions for the v1alpha1 version:
Contains the Kubernetes API definitions for the v1alphav1 version:

- **overcommitclass_types.go**: Defines the OvercommitClass Custom Resource Definition (CRD) structure
- **overcommitclass_webhook.go**: Implements admission webhooks for validation and mutation
Expand Down
62 changes: 0 additions & 62 deletions chart/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion deploy/catalog_source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ metadata:
namespace: olm
spec:
sourceType: grpc
image: ghcr.io/inditextech/k8s-overcommit-operator-catalog:1.1.4
image: ghcr.io/inditextech/k8s-overcommit-operator-catalog:1.0.1
displayName: K8s Overcommit Operator Catalog
publisher: Inditex Tech
62 changes: 0 additions & 62 deletions deploy/chart/1.0.0/README.md

This file was deleted.

62 changes: 0 additions & 62 deletions deploy/chart/1.0.1/README.md

This file was deleted.

14 changes: 7 additions & 7 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ The **k8s-overcommit Operator** is a Kubernetes-native operator designed to inte
|-----------|---------|----------|
| **Overcommit Controller** | Manages main Overcommit resource and deploys OvercommitClass controllers | [`internal/controller/overcommitclass/`](../internal/controller/overcommitclass/) |
| **OvercommitClass Controller** | Watches OvercommitClass resources and configures webhooks | [`internal/resources/generate_resources_overcommit_class_controller_controller.go`](../internal/resources/generate_resources_overcommit_class_controller_controller.go) |
| **Pod Mutating Webhook** | Modifies pod resource requests based on overcommit policies | [`api/v1alpha1/overcommitclass_webhook.go`](../internal/webhook/v1alphav1/mutating/pod_webhook.go) |
| **OvercommitClass Validating Webhook** | Validates OvercommitClass resource specifications | [`internal/webhook/v1alphav1/mutating/pod_webhook.go`](../api/v1alpha1/overcommitclass_webhook.go) |
| **Pod Mutating Webhook** | Modifies pod resource requests based on overcommit policies | [`api/v1alphav1/overcommitclass_webhook.go`](../internal/webhook/v1alphav1/mutating/pod_webhook.go) |
| **OvercommitClass Validating Webhook** | Validates OvercommitClass resource specifications | [`internal/webhook/v1alphav1/mutating/pod_webhook.go`](../api/v1alphav1/overcommitclass_webhook.go) |
| **Pod Validating Webhook** | Validates Pod With Unexisting Class | [`internal/webhook/v1alphav1/validating/pod_webhook.go`](../internal/webhook/v1alphav1/validating/pod_webhook.go) |
| **Certificate Manager** | Generates and manages TLS certificates for webhooks | [`internal/resources/generate_issuer.go`](../internal/resources/generate_issuer.go) |

Expand Down Expand Up @@ -112,7 +112,7 @@ flowchart TD
The main configuration resource that enables the operator:

```yaml
apiVersion: overcommit.inditex.dev/v1alpha1
apiVersion: overcommit.inditex.dev/v1alphav1
kind: Overcommit
metadata:
name: cluster
Expand All @@ -135,7 +135,7 @@ spec:
Defines overcommit policies for different workload types:

```yaml
apiVersion: overcommit.inditex.dev/v1alpha1
apiVersion: overcommit.inditex.dev/v1alphav1
kind: OvercommitClass
metadata:
name: high-density
Expand Down Expand Up @@ -186,7 +186,7 @@ webhooks:

### Webhook Logic Implementation

The webhook implementation in [`api/v1alpha1/overcommitclass_webhook.go`](../api/v1alpha1/overcommitclass_webhook.go) follows this logic:
The webhook implementation in [`api/v1alphav1/overcommitclass_webhook.go`](../api/v1alphav1/overcommitclass_webhook.go) follows this logic:

1. **Label Resolution**: Check pod → namespace → default class
2. **Namespace Exclusion**: Apply regex patterns to exclude critical namespaces
Expand Down Expand Up @@ -336,7 +336,7 @@ make run ARGS="--zap-log-level=debug"
### Development Environment

```yaml
apiVersion: overcommit.inditex.dev/v1alpha1
apiVersion: overcommit.inditex.dev/v1alphav1
kind: OvercommitClass
metadata:
name: development
Expand All @@ -350,7 +350,7 @@ spec:
### Production Environment

```yaml
apiVersion: overcommit.inditex.dev/v1alpha1
apiVersion: overcommit.inditex.dev/v1alphav1
kind: OvercommitClass
metadata:
name: production
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ kubectl apply -f https://github.com/InditexTech/k8s-overcommit-operator/deploy/o
You can create your own or use the one in the route *https://github.com/InditexTech/k8s-overcommit-operator/deploy/subscription.yaml*

```yaml
apiVersion: operators.coreos.com/v1alpha1
apiVersion: operators.coreos.com/v1alphav1
kind: Subscription
metadata:
name: k8s-overcommit-operator
Expand Down