Skip to content

Commit 367639a

Browse files
committed
add: address comments on pr
1 parent 492c4da commit 367639a

12 files changed

+19
-30
lines changed

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ifeq ($(USE_IMAGE_DIGESTS), true)
1616
endif
1717

1818
# Image URL to use all building/pushing image targets
19-
IMG ?= latest
19+
IMG ?= $(IMAGE_TAG_BASE):latest
2020
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
2121
ENVTEST_K8S_VERSION = 1.23
2222

@@ -114,23 +114,19 @@ endif
114114
.PHONY: install
115115
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
116116
$(KUSTOMIZE) build config/default | kubectl apply -f -
117-
$(KUSTOMIZE) build config/configmap | kubectl apply -f -
118117

119118
.PHONY: uninstall
120119
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
121120
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
122-
$(KUSTOMIZE) build config/configmap | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
123121

124122
.PHONY: deploy
125123
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
126124
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
127125
$(KUSTOMIZE) build config/default | kubectl apply -f -
128-
$(KUSTOMIZE) build config/configmap | kubectl apply -f -
129126

130127
.PHONY: undeploy
131128
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
132129
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
133-
$(KUSTOMIZE) build config/configmap | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
134130

135131
## Location to install dependencies to
136132
LOCALBIN ?= $(shell pwd)/bin

config/configmap/instascale_configmap.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

config/configmap/kustomization.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

config/default/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Adds namespace to all resources.
2-
namespace: instascale-1-system
2+
namespace: instascale-system
33

44
# Value of this field is prepended to the
55
# names of all resources, e.g. a deployment named
66
# "wordpress" becomes "alices-wordpress".
77
# Note that it should also match with the prefix (text before '-') of the namespace
88
# field above.
9-
namePrefix: instascale-1-
9+
namePrefix: instascale-
1010

1111
# Labels to add to all resources and selectors.
1212
#commonLabels:

config/rbac/auth_proxy_role_binding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ roleRef:
99
subjects:
1010
- kind: ServiceAccount
1111
name: controller-manager
12-
namespace: system
12+
namespace: instascale-system

config/rbac/instascale_configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
kind: ConfigMap
22
apiVersion: v1
33
metadata:
4-
name: instascale-config
5-
namespace: kube-system
4+
name: config
5+
namespace: instascale-system
66
data:
77
maxScaleoutAllowed: "15"

config/rbac/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ resources:
99
- role_binding.yaml
1010
- leader_election_role.yaml
1111
- leader_election_role_binding.yaml
12+
- instascale_configmap.yaml
1213
# Comment the following 4 lines if you want to disable
1314
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
1415
# which protects your /metrics endpoint.

config/rbac/leader_election_role_binding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ roleRef:
99
subjects:
1010
- kind: ServiceAccount
1111
name: controller-manager
12-
namespace: system
12+
namespace: instascale-system

config/rbac/role.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ metadata:
77
rules:
88
- apiGroups:
99
- ""
10-
resourceNames:
11-
- instascale-config
1210
resources:
1311
- configmaps
12+
verbs:
13+
- get
14+
- apiGroups:
15+
- ""
16+
resources:
1417
- nodes
1518
verbs:
16-
- create
17-
- delete
1819
- get
1920
- list
2021
- patch
2122
- update
22-
- watch
2323
- apiGroups:
2424
- ""
2525
resourceNames:

config/rbac/role_binding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ roleRef:
99
subjects:
1010
- kind: ServiceAccount
1111
name: controller-manager
12-
namespace: system
12+
namespace: instascale-system

config/rbac/service_account.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v1
22
kind: ServiceAccount
33
metadata:
44
name: controller-manager
5-
namespace: system
5+
namespace: instascale-system

main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ var (
5050
)
5151

5252
// +kubebuilder:rbac:groups="",resources=secrets,resourceNames=instascale-ocm-secret,verbs=get
53-
// +kubebuilder:rbac:groups="",resources=nodes;configmaps,resourceNames=instascale-config,verbs=list;watch;get;create;update;delete;patch
53+
// +kubebuilder:rbac:groups="",resources=configmaps,verbs=get
54+
// +kubebuilder:rbac:groups="",resources=nodes,verbs=get;list;patch;update
5455

5556
func init() {
5657
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
@@ -68,8 +69,8 @@ func main() {
6869
var ocmSecretNamespace string
6970
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
7071
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
71-
flag.StringVar(&configsNamespace, "configs-namespace", "kube-system", "The namespace containing the Instacale configmap")
72-
flag.StringVar(&ocmSecretNamespace, "ocm-secret-namespace", "default", "The namespace containing the OCM secret")
72+
flag.StringVar(&configsNamespace, "configs-namespace", "instascale-system", "The namespace containing the Instacale configmap")
73+
flag.StringVar(&ocmSecretNamespace, "ocm-secret-namespace", "instascale-system", "The namespace containing the OCM secret")
7374
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
7475
"Enable leader election for controller manager. "+
7576
"Enabling this will ensure there is only one active controller manager.")

0 commit comments

Comments
 (0)