Skip to content

Commit

Permalink
Merge pull request #12 from vshn/config-improvements
Browse files Browse the repository at this point in the history
Fix default configuration
  • Loading branch information
glrf authored Aug 16, 2021
2 parents 20431d7 + 021e07a commit d29f502
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace: statefulset-resize-controller-system
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: statefulset-resize-controller-
namePrefix: statefulset-resize-

# Labels to add to all resources and selectors.
#commonLabels:
Expand Down
1 change: 1 addition & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resources:
- namespace.yaml
- manager.yaml

generatorOptions:
Expand Down
11 changes: 1 addition & 10 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: system
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -25,9 +18,7 @@ spec:
securityContext:
runAsNonRoot: true
containers:
- command:
- /manager
args:
- args:
- --leader-elect
image: controller:latest
name: manager
Expand Down
6 changes: 6 additions & 0 deletions config/manager/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: system
4 changes: 2 additions & 2 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
name: controller-manager
rules:
- apiGroups:
- apps
Expand Down Expand Up @@ -55,7 +55,7 @@ rules:
- apiGroups:
- ""
resources:
- persistentvolumeclaim
- persistentvolumeclaims
verbs:
- create
- delete
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: manager-role
name: controller-manager
subjects:
- kind: ServiceAccount
name: controller-manager
Expand Down
2 changes: 1 addition & 1 deletion controllers/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type StatefulSetReconciler struct {
//+kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=apps,resources=statefulsets/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=apps,resources=statefulsets/finalizers,verbs=update
//+kubebuilder:rbac:groups=core,resources=persistentvolumeclaim,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=core,resources=persistentvolumeclaims,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=batch,resources=jobs/status,verbs=get;update;patch

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

//go:generate go run sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
//go:generate go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:trivialVersions=true rbac:roleName=manager-role paths="./..."
//go:generate go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:trivialVersions=true rbac:roleName=controller-manager paths="./..."

var (
scheme = runtime.NewScheme()
Expand Down

0 comments on commit d29f502

Please sign in to comment.