Skip to content

Commit

Permalink
Merge pull request #357 from carlosedp/apirelloc
Browse files Browse the repository at this point in the history
Reallocate files according to latest v4 model
  • Loading branch information
carlosedp authored Sep 20, 2024
2 parents 76d422a + 5c969b8 commit 730e685
Show file tree
Hide file tree
Showing 29 changed files with 176 additions and 40 deletions.
15 changes: 14 additions & 1 deletion PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 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: lbconfig.carlosedp.com
layout:
- go.kubebuilder.io/v4
Expand All @@ -15,6 +19,15 @@ resources:
domain: lbconfig.carlosedp.com
group: lb
kind: ExternalLoadBalancer
path: github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1
path: github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: lbconfig.carlosedp.com
group: lb.lbconfig.carlosedp.com
kind: ExternalLoadBalancer
path: github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1
version: v1
version: "3"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: lbconfig-operator
app.kubernetes.io/instance: externalloadbalancer-editor-role
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: lbconfig-operator
name: lbconfig-operator-externalloadbalancer-editor-role
rules:
- apiGroups:
- lb.lbconfig.carlosedp.com
resources:
- externalloadbalancers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- lb.lbconfig.carlosedp.com
resources:
- externalloadbalancers/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: lbconfig-operator
app.kubernetes.io/instance: externalloadbalancer-viewer-role
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: lbconfig-operator
name: lbconfig-operator-externalloadbalancer-viewer-role
rules:
- apiGroups:
- lb.lbconfig.carlosedp.com
resources:
- externalloadbalancers
verbs:
- get
- list
- watch
- apiGroups:
- lb.lbconfig.carlosedp.com
resources:
- externalloadbalancers/status
verbs:
- get
4 changes: 2 additions & 2 deletions bundle/manifests/lbconfig-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ metadata:
categories: Networking
certified: "false"
containerImage: quay.io/carlosedp/lbconfig-operator:v0.5.0
createdAt: "2024-09-16T14:43:45Z"
createdAt: "2024-09-20T15:35:28Z"
description: Manage External Load Balancers allowing creation/update for VIPs
and Servers dynamically via API.
k8sMaxVersion: ""
Expand Down Expand Up @@ -318,7 +318,7 @@ spec:
This project fully open-source and is hosted at [GitHub](https://github.com/carlosedp/lbconfig-operator). Always check the project page and issues for the latest updates and/or solutions to problems encountered. If a problem is detected, please fill an issue. Feature request and improvement issues are welcome.
Some fields inside `providers` are optional and depend on the used backend. Check the [API docs](https://pkg.go.dev/github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1?utm_source=gopls#Provider) which fields are backend-specific.
Some fields inside `providers` are optional and depend on the used backend. Check the [API docs](https://pkg.go.dev/github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1?utm_source=gopls#Provider) which fields are backend-specific.
## Disclaimers
Expand Down
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ import (
"go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
controllers "github.com/carlosedp/lbconfig-operator/internal/controller/externalloadbalancer"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
controllers "github.com/carlosedp/lbconfig-operator/internal/controller/lb.lbconfig.carlosedp.com"
//+kubebuilder:scaffold:imports
)

Expand Down
1 change: 1 addition & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ resources:
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- patches/cainjection_in_externalloadbalancers.yaml
#- path: patches/cainjection_in_lb.lbconfig.carlosedp.com_externalloadbalancers.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch

# the following config is for teaching kustomize how to do kustomization for CRDs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ spec:
This project fully open-source and is hosted at [GitHub](https://github.com/carlosedp/lbconfig-operator). Always check the project page and issues for the latest updates and/or solutions to problems encountered. If a problem is detected, please fill an issue. Feature request and improvement issues are welcome.
Some fields inside `providers` are optional and depend on the used backend. Check the [API docs](https://pkg.go.dev/github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1?utm_source=gopls#Provider) which fields are backend-specific.
Some fields inside `providers` are optional and depend on the used backend. Check the [API docs](https://pkg.go.dev/github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1?utm_source=gopls#Provider) which fields are backend-specific.
## Disclaimers
Expand Down
40 changes: 23 additions & 17 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
resources:
# All RBAC will be applied under this service account in
# the deployment namespace. You may comment out this resource
# if your manager will use a service account that exists at
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
# subjects if changing service account names.
- service_account.yaml
- role.yaml
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml
# All RBAC will be applied under this service account in
# the deployment namespace. You may comment out this resource
# if your manager will use a service account that exists at
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
# subjects if changing service account names.
- service_account.yaml
- role.yaml
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
# default, aiding admins in cluster management. Those roles are
# not used by the Project itself. You can comment the following lines
# if you do not want those helpers be installed with your Project.
- externalloadbalancer_editor_role.yaml
- externalloadbalancer_viewer_role.yaml
4 changes: 2 additions & 2 deletions docs/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ spec:
...
```

Some fields inside `providers` are optional and depend on the used backend. Check the [API docs](https://pkg.go.dev/github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1?utm_source=gopls#Provider) which fields are backend-specific.
Some fields inside `providers` are optional and depend on the used backend. Check the [API docs](https://pkg.go.dev/github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1?utm_source=gopls#Provider) which fields are backend-specific.

CRD Fields:

Expand Down Expand Up @@ -161,7 +161,7 @@ spec:
validatecerts: false # Should check the certificates if API uses HTTPS (true or false) (optional)
```

For more details, check the API documentation at <https://pkg.go.dev/github.com/carlosedp/lbconfig-operator/apis/externalloadbalancer/v1?utm_source=gopls#pkg-types>.
For more details, check the API documentation at <https://pkg.go.dev/github.com/carlosedp/lbconfig-operator/apis/lb.lbconfig.carlosedp.com/v1?utm_source=gopls#pkg-types>.

## Health Check

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"go.opentelemetry.io/otel/trace"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
)

// Tracer name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
. "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_controller"
_ "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_loader"
d "github.com/carlosedp/lbconfig-operator/internal/controller/backend/dummy"
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/backend/dummy/dummy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/go-logr/logr"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
backend "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_controller"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/backend/f5/f5_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/scottdware/go-bigip"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
backend "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_controller"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/backend/f5/f5_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
. "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_controller"
. "github.com/carlosedp/lbconfig-operator/internal/controller/backend/f5"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/backend/haproxy/haproxy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (
"k8s.io/utils/ptr"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
backend_controller "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_controller"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
. "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_controller"
. "github.com/carlosedp/lbconfig-operator/internal/controller/backend/haproxy"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"github.com/go-logr/logr"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
backend "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_controller"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
. "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_controller"
. "github.com/carlosedp/lbconfig-operator/internal/controller/backend/netscaler"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import (
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
controller "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_controller"
_ "github.com/carlosedp/lbconfig-operator/internal/controller/backend/backend_loader"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"strconv"
"time"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (

//+kubebuilder:scaffold:imports

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
)

// These tests use Ginkgo (BDD-style Go testing framework). Refer to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
)

var _ = Describe("ExternalLoadBalancer controller", func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

corev1 "k8s.io/api/core/v1"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
)

// -----------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

lbv1 "github.com/carlosedp/lbconfig-operator/api/externalloadbalancer/v1"
lbv1 "github.com/carlosedp/lbconfig-operator/api/lb.lbconfig.carlosedp.com/v1"
)

var _ = Describe("ExternalLoadBalancer controller", func() {
Expand Down
58 changes: 58 additions & 0 deletions manifests/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,64 @@ rules:
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: lbconfig-operator
app.kubernetes.io/instance: externalloadbalancer-editor-role
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: lbconfig-operator
name: lbconfig-operator-externalloadbalancer-editor-role
rules:
- apiGroups:
- lb.lbconfig.carlosedp.com
resources:
- externalloadbalancers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- lb.lbconfig.carlosedp.com
resources:
- externalloadbalancers/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: lbconfig-operator
app.kubernetes.io/instance: externalloadbalancer-viewer-role
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: lbconfig-operator
name: lbconfig-operator-externalloadbalancer-viewer-role
rules:
- apiGroups:
- lb.lbconfig.carlosedp.com
resources:
- externalloadbalancers
verbs:
- get
- list
- watch
- apiGroups:
- lb.lbconfig.carlosedp.com
resources:
- externalloadbalancers/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: lbconfig-operator-manager-role
rules:
Expand Down

0 comments on commit 730e685

Please sign in to comment.