MicroK8s v1.19 : Enable Linkerd

When I enter this command : microk8s enable linkerd
Fetching Linkerd2 version v2.8.0.
ERRO[0000] could not set namespace from kubectl context: ensure a valid KUBECONFIG path has been set

Can you please suggest how to set it properly for MicroK8s kubectl?

Details about Environment :
MicroK8s V1.19 (Three node Cluster) with High Availability.
Kubernetes Version 1.19.2
Ubuntu v20.04

Thats strange, the enable script takes the kubeconfig file inside MicroK8s.
Fyi linkerd 2.8.0 isnt working fully in 1.19 due to go dropping some certificate CN stuffs.

We are waiting for the linkerd 2.9 release which should come soon.

Btw, is the error happening when enabling linkerd? If yes, can you post the whole console log, and if possible please use markdown syntax to paste it like using the 3 backticks (```)so it is easier to read :grin: thanks

Yes.
Please check the log.

Command : microk8s enable linkerd

Enabling Linkerd2
Addon dns is already enabled.
ERRO[0000] could not set namespace from kubectl context: ensure a valid KUBECONFIG path has been set
namespace/linkerd created
clusterrole.rbac.authorization.k8s.io/linkerd-linkerd-identity created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-identity created
serviceaccount/linkerd-identity created
clusterrole.rbac.authorization.k8s.io/linkerd-linkerd-controller created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-controller created
serviceaccount/linkerd-controller created
clusterrole.rbac.authorization.k8s.io/linkerd-linkerd-destination created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-destination created
serviceaccount/linkerd-destination created
role.rbac.authorization.k8s.io/linkerd-heartbeat created
rolebinding.rbac.authorization.k8s.io/linkerd-heartbeat created
serviceaccount/linkerd-heartbeat created
role.rbac.authorization.k8s.io/linkerd-web created
rolebinding.rbac.authorization.k8s.io/linkerd-web created
clusterrole.rbac.authorization.k8s.io/linkerd-linkerd-web-check created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-web-check created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-web-admin created
serviceaccount/linkerd-web created
Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
customresourcedefinition.apiextensions.k8s.io/serviceprofiles.linkerd.io created
customresourcedefinition.apiextensions.k8s.io/trafficsplits.split.smi-spec.io created
clusterrole.rbac.authorization.k8s.io/linkerd-linkerd-prometheus created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-prometheus created
serviceaccount/linkerd-prometheus created
clusterrole.rbac.authorization.k8s.io/linkerd-linkerd-proxy-injector created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-proxy-injector created
serviceaccount/linkerd-proxy-injector created
secret/linkerd-proxy-injector-tls created
Warning: admissionregistration.k8s.io/v1beta1 MutatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration
mutatingwebhookconfiguration.admissionregistration.k8s.io/linkerd-proxy-injector-webhook-config created
clusterrole.rbac.authorization.k8s.io/linkerd-linkerd-sp-validator created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-sp-validator created
serviceaccount/linkerd-sp-validator created
secret/linkerd-sp-validator-tls created
Warning: admissionregistration.k8s.io/v1beta1 ValidatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration
validatingwebhookconfiguration.admissionregistration.k8s.io/linkerd-sp-validator-webhook-config created
clusterrole.rbac.authorization.k8s.io/linkerd-linkerd-tap created
clusterrole.rbac.authorization.k8s.io/linkerd-linkerd-tap-admin created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-tap created
clusterrolebinding.rbac.authorization.k8s.io/linkerd-linkerd-tap-auth-delegator created
serviceaccount/linkerd-tap created
rolebinding.rbac.authorization.k8s.io/linkerd-linkerd-tap-auth-reader created
secret/linkerd-tap-tls created
apiservice.apiregistration.k8s.io/v1alpha1.tap.linkerd.io created
podsecuritypolicy.policy/linkerd-linkerd-control-plane created
role.rbac.authorization.k8s.io/linkerd-psp created
rolebinding.rbac.authorization.k8s.io/linkerd-psp created
configmap/linkerd-config created
secret/linkerd-identity-issuer created
service/linkerd-identity created
deployment.apps/linkerd-identity created
service/linkerd-controller-api created
deployment.apps/linkerd-controller created
service/linkerd-dst created
deployment.apps/linkerd-destination created
cronjob.batch/linkerd-heartbeat created
service/linkerd-web created
deployment.apps/linkerd-web created
configmap/linkerd-prometheus-config created
service/linkerd-prometheus created
deployment.apps/linkerd-prometheus created
deployment.apps/linkerd-proxy-injector created
service/linkerd-proxy-injector created
service/linkerd-sp-validator created
deployment.apps/linkerd-sp-validator created
service/linkerd-tap created
deployment.apps/linkerd-tap created
configmap/linkerd-config-addons created
serviceaccount/linkerd-grafana created
configmap/linkerd-grafana-config created
service/linkerd-grafana created
deployment.apps/linkerd-grafana created
Linkerd is starting

The error seems to be benign. But linkerd 2.8 currently doesn’t work with kubernetes 1.19.

You dont see linkerd pods in linkerd namespace?

The pod is initializing.

microk8s kubectl get all -n linkerd
NAME                                          READY   STATUS            RESTARTS   AGE
pod/linkerd-controller-5c75958df9-j8h9b       0/2     PodInitializing   0          26s
pod/linkerd-sp-validator-686dfc44bc-xxzc9     0/2     PodInitializing   0          25s
pod/linkerd-web-64f955df6d-lnl9h              0/2     PodInitializing   0          26s
pod/linkerd-tap-596b54856b-gkpb8              0/2     PodInitializing   0          25s
pod/linkerd-identity-7ff89b9bcf-mkzkx         0/2     PodInitializing   0          26s
pod/linkerd-prometheus-7fccf4498b-v2f9v       0/2     PodInitializing   0          26s
pod/linkerd-destination-685564745b-4m8lc      0/2     PodInitializing   0          26s
pod/linkerd-proxy-injector-59d95dff9b-7ckvh   0/2     PodInitializing   0          25s
pod/linkerd-grafana-98677b5d4-bsd8m           0/2     PodInitializing   0          25s

NAME                             TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
service/linkerd-identity         ClusterIP   10.152.183.74    <none>        8080/TCP            26s
service/linkerd-controller-api   ClusterIP   10.152.183.83    <none>        8085/TCP            26s
service/linkerd-dst              ClusterIP   10.152.183.226   <none>        8086/TCP            26s
service/linkerd-web              ClusterIP   10.152.183.107   <none>        8084/TCP,9994/TCP   26s
service/linkerd-prometheus       ClusterIP   10.152.183.14    <none>        9090/TCP            26s
service/linkerd-proxy-injector   ClusterIP   10.152.183.126   <none>        443/TCP             26s
service/linkerd-sp-validator     ClusterIP   10.152.183.68    <none>        443/TCP             26s
service/linkerd-tap              ClusterIP   10.152.183.231   <none>        8088/TCP,443/TCP    26s
service/linkerd-grafana          ClusterIP   10.152.183.247   <none>        3000/TCP            26s

NAME                                     READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/linkerd-identity         0/1     1            0           26s
deployment.apps/linkerd-destination      0/1     1            0           26s
deployment.apps/linkerd-prometheus       0/1     1            0           26s
deployment.apps/linkerd-web              0/1     1            0           26s
deployment.apps/linkerd-controller       0/1     1            0           26s
deployment.apps/linkerd-proxy-injector   0/1     1            0           26s
deployment.apps/linkerd-sp-validator     0/1     1            0           26s
deployment.apps/linkerd-tap              0/1     1            0           26s
deployment.apps/linkerd-grafana          0/1     1            0           26s

NAME                                                DESIRED   CURRENT   READY   AGE
replicaset.apps/linkerd-identity-7ff89b9bcf         1         1         0       26s
replicaset.apps/linkerd-destination-685564745b      1         1         0       26s
replicaset.apps/linkerd-prometheus-7fccf4498b       1         1         0       26s
replicaset.apps/linkerd-web-64f955df6d              1         1         0       26s
replicaset.apps/linkerd-controller-5c75958df9       1         1         0       26s
replicaset.apps/linkerd-proxy-injector-59d95dff9b   1         1         0       26s
replicaset.apps/linkerd-sp-validator-686dfc44bc     1         1         0       26s
replicaset.apps/linkerd-tap-596b54856b              1         1         0       26s
replicaset.apps/linkerd-grafana-98677b5d4           1         1         0       26s

NAME                              SCHEDULE      SUSPEND   ACTIVE   LAST SCHEDULE   AGE
cronjob.batch/linkerd-heartbeat   59 9 * * *    False     0        <none>          26s

This looks good to me. It takes sometime to have them all up and running.

Not all are running.

 microk8s kubectl get all -n linkerd
NAME                                          READY   STATUS         RESTARTS   AGE
pod/linkerd-heartbeat-1604743140-54ngg        0/1     Error          0          4h41m
pod/linkerd-heartbeat-1604743140-8dhvz        0/1     Error          0          4h41m
pod/linkerd-heartbeat-1604743140-f2j8g        0/1     Error          0          4h41m
pod/linkerd-heartbeat-1604743140-p4l2v        0/1     Error          0          4h40m
pod/linkerd-identity-7ff89b9bcf-mkzkx         0/2     NodeAffinity   0          3d4h
pod/linkerd-destination-685564745b-4m8lc      0/2     NodeAffinity   0          3d4h
pod/linkerd-identity-7ff89b9bcf-ctqg6         2/2     Running        0          11m
pod/linkerd-proxy-injector-59d95dff9b-7ckvh   2/2     Running        10         3d4h
pod/linkerd-grafana-98677b5d4-bsd8m           2/2     Running        8          3d4h
pod/linkerd-controller-5c75958df9-j8h9b       2/2     Running        8          3d4h
pod/linkerd-sp-validator-686dfc44bc-xxzc9     2/2     Running        4          3d4h
pod/linkerd-web-64f955df6d-lnl9h              2/2     Running        8          3d4h
pod/linkerd-destination-685564745b-tw5cg      2/2     Running        0          11m
pod/linkerd-prometheus-7fccf4498b-v2f9v       2/2     Running        8          3d4h
pod/linkerd-tap-596b54856b-gkpb8              2/2     Running        10         3d4h

NAME                             TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
service/linkerd-identity         ClusterIP   10.152.183.74    <none>        8080/TCP            3d4h
service/linkerd-controller-api   ClusterIP   10.152.183.83    <none>        8085/TCP            3d4h
service/linkerd-dst              ClusterIP   10.152.183.226   <none>        8086/TCP            3d4h
service/linkerd-web              ClusterIP   10.152.183.107   <none>        8084/TCP,9994/TCP   3d4h
service/linkerd-prometheus       ClusterIP   10.152.183.14    <none>        9090/TCP            3d4h
service/linkerd-proxy-injector   ClusterIP   10.152.183.126   <none>        443/TCP             3d4h
service/linkerd-sp-validator     ClusterIP   10.152.183.68    <none>        443/TCP             3d4h
service/linkerd-tap              ClusterIP   10.152.183.231   <none>        8088/TCP,443/TCP    3d4h
service/linkerd-grafana          ClusterIP   10.152.183.247   <none>        3000/TCP            3d4h

NAME                                     READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/linkerd-identity         1/1     1            1           3d4h
deployment.apps/linkerd-proxy-injector   1/1     1            1           3d4h
deployment.apps/linkerd-grafana          1/1     1            1           3d4h
deployment.apps/linkerd-controller       1/1     1            1           3d4h
deployment.apps/linkerd-sp-validator     1/1     1            1           3d4h
deployment.apps/linkerd-web              1/1     1            1           3d4h
deployment.apps/linkerd-destination      1/1     1            1           3d4h
deployment.apps/linkerd-prometheus       1/1     1            1           3d4h
deployment.apps/linkerd-tap              1/1     1            1           3d4h

NAME                                                DESIRED   CURRENT   READY   AGE
replicaset.apps/linkerd-identity-7ff89b9bcf         1         1         1       3d4h
replicaset.apps/linkerd-proxy-injector-59d95dff9b   1         1         1       3d4h
replicaset.apps/linkerd-grafana-98677b5d4           1         1         1       3d4h
replicaset.apps/linkerd-controller-5c75958df9       1         1         1       3d4h
replicaset.apps/linkerd-sp-validator-686dfc44bc     1         1         1       3d4h
replicaset.apps/linkerd-web-64f955df6d              1         1         1       3d4h
replicaset.apps/linkerd-destination-685564745b      1         1         1       3d4h
replicaset.apps/linkerd-prometheus-7fccf4498b       1         1         1       3d4h
replicaset.apps/linkerd-tap-596b54856b              1         1         1       3d4h

NAME                                     COMPLETIONS   DURATION   AGE
job.batch/linkerd-heartbeat-1604743140   0/1           4h41m      4h41m

NAME                              SCHEDULE      SUSPEND   ACTIVE   LAST SCHEDULE   AGE
cronjob.batch/linkerd-heartbeat   59 9 * * *    False     0        4h41m           3d4h

Hi. Can you try the linkerd edge version? We are waiting for the linkerd v2.9.0 release as the one bundled 2.8.0 has some golang certificate changes that prevents it from running properly on a 1.19 kubernetes.
Thanks

I’m just curious to know how to use Linkerd edge version in Microk8s.
I just enable add-ons. Any help/link will help me to figure it out myself?

For linkerd edge version, you just have to follow the linkerd documentations.
Disable the linkerd addon then follow the linkerd docs.