Skip to content

Commit

Permalink
change manager to egress-controller in manifests
Browse files Browse the repository at this point in the history
Signed-off-by: gotti <[email protected]>
  • Loading branch information
gotti committed Aug 23, 2024
1 parent 8f55dde commit 1aa1dbb
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ help: ## Display this help.
##@ Development

.PHONY: manifests
manifests: controller-gen yq ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
manifests: controller-gen $(YQ) ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=egress-controller-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(YQ) -i 'del(.spec.versions.[].schema.openAPIV3Schema.properties.spec.properties.template | .. |select(key == "description"))' config/crd/bases/pona.cybozu.com_egresses.yaml

.PHONY: generate
Expand Down
6 changes: 3 additions & 3 deletions config/default/metrics_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ apiVersion: v1
kind: Service
metadata:
labels:
control-plane: controller-manager
control-plane: egress-controller
app.kubernetes.io/name: pona
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
name: egress-controller-metrics-service
namespace: system
spec:
ports:
Expand All @@ -14,4 +14,4 @@ spec:
protocol: TCP
targetPort: 8443
selector:
control-plane: controller-manager
control-plane: egress-controller
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
control-plane: egress-controller
app.kubernetes.io/name: pona
app.kubernetes.io/managed-by: kustomize
name: system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
name: egress-controller
namespace: system
labels:
control-plane: controller-manager
control-plane: egress-controller
app.kubernetes.io/name: pona
app.kubernetes.io/managed-by: kustomize
spec:
selector:
matchLabels:
control-plane: controller-manager
control-plane: egress-controller
replicas: 1
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
control-plane: egress-controller
spec:
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
# according to the platforms which are supported by your solution.
Expand Down Expand Up @@ -90,5 +90,5 @@ spec:
requests:
cpu: 10m
memory: 64Mi
serviceAccountName: controller-manager
serviceAccountName: egress-controller
terminationGracePeriodSeconds: 10
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resources:
- manager.yaml
- egress-controller.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
Expand Down
6 changes: 3 additions & 3 deletions config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
control-plane: controller-manager
control-plane: egress-controller
app.kubernetes.io/name: pona
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-monitor
name: egress-controller-metrics-monitor
namespace: system
spec:
endpoints:
Expand All @@ -27,4 +27,4 @@ spec:
insecureSkipVerify: true
selector:
matchLabels:
control-plane: controller-manager
control-plane: egress-controller
2 changes: 1 addition & 1 deletion config/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ roleRef:
name: leader-election-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: egress-controller
namespace: system
2 changes: 1 addition & 1 deletion config/rbac/metrics_auth_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ roleRef:
name: metrics-auth-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: egress-controller
namespace: system
2 changes: 1 addition & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: manager-role
name: egress-controller-role
rules:
- apiGroups:
- apps
Expand Down
6 changes: 3 additions & 3 deletions config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ metadata:
labels:
app.kubernetes.io/name: pona
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
name: egress-controller-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: manager-role
name: egress-controller-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: egress-controller
namespace: system
2 changes: 1 addition & 1 deletion config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
labels:
app.kubernetes.io/name: pona
app.kubernetes.io/managed-by: kustomize
name: controller-manager
name: egress-controller
namespace: system
8 changes: 4 additions & 4 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ var _ = Describe("controller", Ordered, func() {
_, err = utils.Run(cmd)
ExpectWithOffset(1, err).NotTo(HaveOccurred())

By("deploying the controller-manager")
By("deploying the egress-controller")
cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
_, err = utils.Run(cmd)
ExpectWithOffset(1, err).NotTo(HaveOccurred())

By("validating that the controller-manager pod is running as expected")
By("validating that the egress-controller pod is running as expected")
verifyControllerUp := func() error {
// Get pod name

cmd = exec.Command("kubectl", "get",
"pods", "-l", "control-plane=controller-manager",
"pods", "-l", "control-plane=egress-controller",
"-o", "go-template={{ range .items }}"+
"{{ if not .metadata.deletionTimestamp }}"+
"{{ .metadata.name }}"+
Expand All @@ -85,7 +85,7 @@ var _ = Describe("controller", Ordered, func() {
return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames))
}
controllerPodName = podNames[0]
ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("controller-manager"))
ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("egress-controller"))

// Validate pod status
cmd = exec.Command("kubectl", "get",
Expand Down

0 comments on commit 1aa1dbb

Please sign in to comment.