Skip to content

Commit

Permalink
Remove the linkerd-controller pod (linkerd#6039)
Browse files Browse the repository at this point in the history
* Remove the `linkerd-controller` pod

Now that we got rid of the `Version` API (linkerd#6000) and the destination API forwarding business in `linkerd-controller` (linkerd#5993), we can get rid of the `linkerd-controller` pod.

## Removals

- Deleted everything under `/controller/api/public` and `/controller/cmd/public-api`.
- Moved `/controller/api/public/test_helper.go` to `/controller/api/destination/test_helper.go` because those are really utils for destination testing. I also extracted from there the prometheus mock structs and put that under `/pkg/prometheus/test_helper.go`, which is now by both the `linkerd diagnostics endpoints` and the `metrics-api` tests, removing some duplication.
- Deleted the `controller.yaml` and `controller-rbac.yaml` helm templates along with the `publicAPIResources` and `publicAPIProxyResources` helm values.

## Health checks

- Removed the `can initialize the client` check given such client is no longer needed. The `linkerd-api` section was left with only the check `control pods are ready`, so I moved that under the `linkerd-existence` section and got rid of the `linkerd-api` section altogether.
- In that same `linkerd-existence` section, got rid of the `controller pod is running` check.

## Other changes

- Fixed the Control Plane section of the dashboard, taking account the disappearance of `linkerd-controller` and previously, of `linkerd-sp-validator`.

Signed-off-by: Jijeesh <jijeesh.ka@gmail.com>
  • Loading branch information
alpeb authored and jijeesh committed Apr 21, 2021
1 parent 497fa47 commit 062b528
Show file tree
Hide file tree
Showing 69 changed files with 180 additions and 5,974 deletions.
2 changes: 1 addition & 1 deletion charts/linkerd2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Kubernetes: `>=1.16.0-0`
| cniEnabled | bool | `false` | enabling this omits the NET_ADMIN capability in the PSP and the proxy-init container when injecting the proxy; requires the linkerd-cni plugin to already be installed |
| controlPlaneTracing | bool | `false` | enables control plane tracing |
| controlPlaneTracingNamespace | string | `"linkerd-jaeger"` | namespace to send control plane traces to |
| controllerImage | string | `"cr.l5d.io/linkerd/controller"` | Docker image for the controller and identity components |
| controllerImage | string | `"cr.l5d.io/linkerd/controller"` | Docker image for the destination and identity components |
| controllerLogFormat | string | `"plain"` | Log format for the control plane components |
| controllerLogLevel | string | `"info"` | Log level for the control plane components |
| controllerReplicas | int | `1` | Number of replicas for each control plane pod |
Expand Down
53 changes: 0 additions & 53 deletions charts/linkerd2/templates/controller-rbac.yaml

This file was deleted.

140 changes: 0 additions & 140 deletions charts/linkerd2/templates/controller.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions charts/linkerd2/templates/psp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ roleRef:
name: linkerd-psp
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: linkerd-controller
namespace: {{.Values.namespace}}
- kind: ServiceAccount
name: linkerd-destination
namespace: {{.Values.namespace}}
Expand Down
1 change: 0 additions & 1 deletion charts/linkerd2/values-ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ controllerResources: &controller_resources
limit: 250Mi
request: 50Mi
destinationResources: *controller_resources
publicAPIResources: *controller_resources

# identity configuration
identityResources:
Expand Down
11 changes: 1 addition & 10 deletions charts/linkerd2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ omitWebhookSideEffects: false
webhookFailurePolicy: Ignore


# controllerImage -- Docker image for the controller and identity
# components
# controllerImage -- Docker image for the destination and identity components
controllerImage: cr.l5d.io/linkerd/controller
# -- Number of replicas for each control plane pod
controllerReplicas: 1
Expand Down Expand Up @@ -275,14 +274,6 @@ profileValidator:
#`proxy.resources` for sub-fields)
#spValidatorResources:

# -|- CPU and Memory resources required by controllers publicAPI (see
#`proxy.resources` for sub-fields)
#publicAPIResources:
#-|- CPU and Memory resources required by proxy injected into controllers public
#API pod (see `proxy.resources` for sub-fields) values
#`proxy.resources`
#publicAPIProxyResources:

# If the namespace is controlled by an external tool or can't be installed with Helm
# you can disable its installation. In this case:
# - The namespace created by the external tool must match the namespace value above
Expand Down
1 change: 0 additions & 1 deletion cli/cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ func configureAndRunChecks(cmd *cobra.Command, wout io.Writer, werr io.Writer, s

if stage != configStage {
checks = append(checks, healthcheck.LinkerdControlPlaneExistenceChecks)
checks = append(checks, healthcheck.LinkerdAPIChecks)
checks = append(checks, healthcheck.LinkerdIdentity)
checks = append(checks, healthcheck.LinkerdWebhooksAndAPISvcTLS)

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This command provides subcommands to diagnose the functionality of Linkerd.`,
linkerd diagnostics proxy-metrics -n emojivoto deploy/web
# Get the endpoints for authorities in Linkerd's control-plane itself
linkerd diagnostics endpoints linkerd-controller-api.linkerd.svc.cluster.local:8085
linkerd diagnostics endpoints web.linkerd-viz.svc.cluster.local:8084
# Install service profiles for the control-plane components.
linkerd diagnostics install-sp
Expand Down
1 change: 0 additions & 1 deletion cli/cmd/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func newCmdEndpoints() *cobra.Command {
linkerd diagnostics endpoints -o json emoji-svc.emojivoto.svc.cluster.local:8080 web-svc.emojivoto.svc.cluster.local:80
# get the endpoints for authorities in Linkerd's control-plane itself
linkerd diagnostics endpoints linkerd-controller-api.linkerd.svc.cluster.local:8085
linkerd diagnostics endpoints web.linkerd-viz.svc.cluster.local:8084`

cmd := &cobra.Command{
Expand Down
28 changes: 14 additions & 14 deletions cli/cmd/endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"testing"

pb "github.com/linkerd/linkerd2-proxy-api/go/destination"
"github.com/linkerd/linkerd2/controller/api/public"
"github.com/linkerd/linkerd2/controller/api/destination"
)

type endpointsExp struct {
options *endpointsOptions
authorities []string
endpoints []public.AuthorityEndpoints
endpoints []destination.AuthorityEndpoints
file string
}

Expand All @@ -21,11 +21,11 @@ func TestEndpoints(t *testing.T) {
testEndpointsCall(endpointsExp{
options: options,
authorities: []string{"emoji-svc.emojivoto.svc.cluster.local:8080", "voting-svc.emojivoto.svc.cluster.local:8080"},
endpoints: []public.AuthorityEndpoints{
endpoints: []destination.AuthorityEndpoints{
{
Namespace: "emojivoto",
ServiceID: "emoji-svc",
Pods: []public.PodDetails{
Pods: []destination.PodDetails{
{
Name: "emoji-6bf9f47bd5-jjcrl",
IP: 16909060,
Expand All @@ -36,7 +36,7 @@ func TestEndpoints(t *testing.T) {
{
Namespace: "emojivoto",
ServiceID: "voting-svc",
Pods: []public.PodDetails{
Pods: []destination.PodDetails{
{
Name: "voting-7bf9f47bd5-jjdrl",
IP: 84281096,
Expand All @@ -53,11 +53,11 @@ func TestEndpoints(t *testing.T) {
testEndpointsCall(endpointsExp{
options: options,
authorities: []string{"emoji-svc.emojivoto.svc.cluster.local:8080", "voting-svc.emojivoto2.svc.cluster.local:8080"},
endpoints: []public.AuthorityEndpoints{
endpoints: []destination.AuthorityEndpoints{
{
Namespace: "emojivoto",
ServiceID: "emoji-svc",
Pods: []public.PodDetails{
Pods: []destination.PodDetails{
{
Name: "emoji-6bf9f47bd5-jjcrl",
IP: 16909060,
Expand All @@ -68,7 +68,7 @@ func TestEndpoints(t *testing.T) {
{
Namespace: "emojivoto2",
ServiceID: "voting-svc",
Pods: []public.PodDetails{
Pods: []destination.PodDetails{
{
Name: "voting-7bf9f47bd5-jjdrl",
IP: 84281096,
Expand All @@ -86,11 +86,11 @@ func TestEndpoints(t *testing.T) {
testEndpointsCall(endpointsExp{
options: options,
authorities: []string{"emoji-svc.emojivoto.svc.cluster.local:8080", "voting-svc.emojivoto.svc.cluster.local:8080"},
endpoints: []public.AuthorityEndpoints{
endpoints: []destination.AuthorityEndpoints{
{
Namespace: "emojivoto",
ServiceID: "emoji-svc",
Pods: []public.PodDetails{
Pods: []destination.PodDetails{
{
Name: "emoji-6bf9f47bd5-jjcrl",
IP: 16909060,
Expand All @@ -101,7 +101,7 @@ func TestEndpoints(t *testing.T) {
{
Namespace: "emojivoto",
ServiceID: "voting-svc",
Pods: []public.PodDetails{
Pods: []destination.PodDetails{
{
Name: "voting-7bf9f47bd5-jjdrl",
IP: 84281096,
Expand All @@ -118,12 +118,12 @@ func TestEndpoints(t *testing.T) {
func testEndpointsCall(exp endpointsExp, t *testing.T) {
updates := make([]pb.Update, 0)
for _, endpoint := range exp.endpoints {
addrSet := public.BuildAddrSet(endpoint)
addrSet := destination.BuildAddrSet(endpoint)
updates = append(updates, pb.Update{Update: &pb.Update_Add{Add: addrSet}})
}

mockClient := &public.MockAPIClient{
DestinationGetClientToReturn: &public.MockDestinationGetClient{
mockClient := &destination.MockAPIClient{
DestinationGetClientToReturn: &destination.MockDestinationGetClient{
UpdatesToReturn: updates,
},
}
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ var (
templatesConfigStage = []string{
"templates/namespace.yaml",
"templates/identity-rbac.yaml",
"templates/controller-rbac.yaml",
"templates/destination-rbac.yaml",
"templates/heartbeat-rbac.yaml",
"templates/serviceprofile-crd.yaml",
Expand All @@ -74,7 +73,6 @@ var (
templatesControlPlaneStage = []string{
"templates/config.yaml",
"templates/identity.yaml",
"templates/controller.yaml",
"templates/destination.yaml",
"templates/heartbeat.yaml",
"templates/proxy-injector.yaml",
Expand Down
Loading

0 comments on commit 062b528

Please sign in to comment.