Skip to content

Commit

Permalink
refactor(control-plane): Changed the controller Domain
Browse files Browse the repository at this point in the history
  • Loading branch information
isala404 committed Feb 15, 2022
1 parent 81e98e7 commit d4b5588
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

## Python
**/__pycache__/**
**/venv/**
**/venv/**
6 changes: 3 additions & 3 deletions control-plane/PROJECT
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
domain: lazykoala.isala.me
domain: isala.me
layout:
- go.kubebuilder.io/v3
projectName: control-plane
projectName: control-plane-2
repo: github.com/MrSupiri/LazyKoala
resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: lazykoala.isala.me
domain: isala.me
group: lazykoala
kind: Inspector
path: github.com/MrSupiri/LazyKoala/api/v1alpha1
Expand Down
4 changes: 2 additions & 2 deletions control-plane/api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

// Package v1alpha1 contains API Schema definitions for the lazykoala v1alpha1 API group
//+kubebuilder:object:generate=true
//+groupName=lazykoala.lazykoala.isala.me
//+groupName=lazykoala.isala.me
package v1alpha1

import (
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "lazykoala.lazykoala.isala.me", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "lazykoala.isala.me", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: inspectors.lazykoala.lazykoala.isala.me
name: inspectors.lazykoala.isala.me
spec:
group: lazykoala.lazykoala.isala.me
group: lazykoala.isala.me
names:
kind: Inspector
listKind: InspectorList
Expand Down
2 changes: 1 addition & 1 deletion control-plane/config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/lazykoala.lazykoala.isala.me_inspectors.yaml
- bases/lazykoala.isala.me_inspectors.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: inspectors.lazykoala.lazykoala.isala.me
name: inspectors.lazykoala.isala.me
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: inspectors.lazykoala.lazykoala.isala.me
name: inspectors.lazykoala.isala.me
spec:
conversion:
strategy: Webhook
Expand Down
18 changes: 9 additions & 9 deletions control-plane/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Adds namespace to all resources.
namespace: control-plane-system
namespace: lazy-koala

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: control-plane-
namePrefix: lazy-koala-

# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue

bases:
- ../crd
- ../rbac
- ../manager
- ../crd
- ../rbac
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- ../webhook
Expand All @@ -25,10 +25,10 @@ bases:
#- ../prometheus

patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml

# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ webhook:
port: 9443
leaderElection:
leaderElect: true
resourceName: 1f823054.lazykoala.isala.me
resourceName: 1f823054.isala.me
4 changes: 2 additions & 2 deletions control-plane/config/rbac/inspector_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: inspector-editor-role
rules:
- apiGroups:
- lazykoala.lazykoala.isala.me
- lazykoala.isala.me
resources:
- inspectors
verbs:
Expand All @@ -17,7 +17,7 @@ rules:
- update
- watch
- apiGroups:
- lazykoala.lazykoala.isala.me
- lazykoala.isala.me
resources:
- inspectors/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions control-plane/config/rbac/inspector_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ metadata:
name: inspector-viewer-role
rules:
- apiGroups:
- lazykoala.lazykoala.isala.me
- lazykoala.isala.me
resources:
- inspectors
verbs:
- get
- list
- watch
- apiGroups:
- lazykoala.lazykoala.isala.me
- lazykoala.isala.me
resources:
- inspectors/status
verbs:
Expand Down
6 changes: 3 additions & 3 deletions control-plane/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rules:
- list
- watch
- apiGroups:
- lazykoala.lazykoala.isala.me
- lazykoala.isala.me
resources:
- inspectors
verbs:
Expand All @@ -45,13 +45,13 @@ rules:
- update
- watch
- apiGroups:
- lazykoala.lazykoala.isala.me
- lazykoala.isala.me
resources:
- inspectors/finalizers
verbs:
- update
- apiGroups:
- lazykoala.lazykoala.isala.me
- lazykoala.isala.me
resources:
- inspectors/status
verbs:
Expand Down
12 changes: 0 additions & 12 deletions control-plane/config/samples/helper.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
apiVersion: lazykoala.lazykoala.isala.me/v1alpha1
apiVersion: lazykoala.isala.me/v1alpha1
kind: Inspector
metadata:
name: inspector-sample
spec:
deploymentRef: service-2-5e7b1ab0
serviceRef: service-2-5e7b1ab0
namespace: default
modelURI: path/to/checkpoint.ckpt

# TODO(user): Add fields here
9 changes: 5 additions & 4 deletions control-plane/controllers/inspector_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package controllers
import (
"context"
"fmt"
"time"

"gopkg.in/yaml.v3"
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1"
Expand All @@ -30,7 +32,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"time"

lazykoalav1alpha1 "github.com/MrSupiri/LazyKoala/api/v1alpha1"
)
Expand All @@ -49,9 +50,9 @@ type ScrapePoint struct {
IsService bool `yaml:"isService"`
}

//+kubebuilder:rbac:groups=lazykoala.lazykoala.isala.me,resources=inspectors,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=lazykoala.lazykoala.isala.me,resources=inspectors/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=lazykoala.lazykoala.isala.me,resources=inspectors/finalizers,verbs=update
//+kubebuilder:rbac:groups=lazykoala.isala.me,resources=inspectors,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=lazykoala.isala.me,resources=inspectors/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=lazykoala.isala.me,resources=inspectors/finalizers,verbs=update
//+kubebuilder:rbac:groups="",resources=pods;services;namespaces,verbs=get;watch;list
//+kubebuilder:rbac:groups="",resources=configmaps,verbs=get;watch;list;update;patch
//+kubebuilder:rbac:groups="",resources=events,verbs=create;patch
Expand Down
2 changes: 1 addition & 1 deletion control-plane/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func main() {
Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "1f823054.lazykoala.isala.me",
LeaderElectionID: "1f823054.isala.me",
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down

0 comments on commit d4b5588

Please sign in to comment.