Troubleshooting
Use resource conditions first, then operator logs. Every custom resource has a
single Ready condition. Failure reasons are ConnectionFailed on routers and
ApplyFailed on managed objects. The message is the last reconcile error.
kubectl get mikrotikrouters,mikrotikdnsrecords,mikrotikroutes,mikrotikportforwards,mikrotikfirewallrules -A
kubectl describe mikrotikrouter -n mikrotik-system home-router
kubectl -n mikrotik-operator-system logs -l app.kubernetes.io/name=mikrotik-operator
Helm installs two replicas with leader election. Only the elected manager reconciles RouterOS. Check which replica holds the lease if logs look idle:
kubectl -n mikrotik-operator-system get lease mikrotik-operator -o yaml
Problem: implicit router selection is invalid
Symptoms:
Ready=Falsewithmultiple MikroTikRouters exist; set routerRef explicitly- The same message scoped to one namespace
Cause: The operator only auto-selects a router when exactly one
non-deleting MikroTikRouter exists in the resource namespace, or, if that
namespace has none, exactly one non-deleting router in the cluster. Connected
status does not change that count.
Solution:
- Set
spec.routerRefon custom resources, ormikrotik.operator.io/router-refon Services, Ingresses, and HTTPRoutes. - Use
namefor a router in the same namespace, ornamespace/namefor a router in another namespace. - A name-only value can also match a unique cluster-wide router with that
name. Prefer
namespace/namewhen more than one namespace has routers.
Verification: Ready=True and status.routerRef shows the selected
router.
Problem: router stays disconnected
Symptoms:
status.connected=falseReady=False, reasonConnectionFailed
Cause: The operator cannot dial or log in to the RouterOS API. Default
ports are 8728 without TLS and 8729 with spec.tls: true. TLS uses the
Go default certificate verification; a self-signed RouterOS certificate fails
unless the cluster trusts that CA.
Solution:
- Confirm the Secret is in the router namespace and has
usernameandpasswordkeys. - From a debug Pod in the operator namespace, check TCP reachability to
address:port. - Match
spec.tlsto the API service you enabled (/ip serviceapivsapi-ssl). - For TLS, install a certificate the operator can verify, or use the
non-TLS API on a trusted network.
spec.addressmust match a name or IP on that certificate.
Verification: kubectl get mikrotikrouter shows Connected=true.
Problem: ClusterIP routes or NodePort NAT never appear
Symptoms:
- DNS record exists but no
/ip route/32entry ApplyFailedmentioningno node InternalIPorservice is not addressable
Cause: ClusterIP /32 routes and NodePort NAT targets use each node’s
InternalIP. Headless Services and Services without a ClusterIP are skipped.
SCTP and other non-TCP/UDP ports are not forwarded.
Solution: Confirm nodes have InternalIP addresses (kubectl get nodes
-o wide). Use a ClusterIP Service for in-cluster routes, or a NodePort
Service for node-IP NAT.
Verification: The owned MikroTikRoute or MikroTikPortForward is
Ready=True.
Problem: two routers claim the same device
Symptoms:
ConnectionFailedmentioning an endpointis owned byanotherMikroTikRouter- Duplicate endpoint errors on a single router object
Cause: Endpoint identity is address|port|tls. Two MikroTikRouter
objects cannot manage the same physical API endpoint. Credential rotation or
renaming an endpoint does not count as a new device.
Solution: Keep one router object per device. Split HA pairs with different
addresses under spec.routers.
Problem: Ingress or HTTPRoute creates nothing
Symptoms:
- No owned
MikroTikDNSRecordorMikroTikPortForwardchildren - Changing
public-iphas no effect
Cause: Ingresses must set spec.ingressClassName: mikrotik and the
cluster IngressClass controller must be mikrotik.operator.io/controller.
HTTPRoutes are ignored unless Helm gatewayAPI.enabled is true, the parent
Gateway uses the configured GatewayClass, and a listener accepts the route
(HTTP or HTTPS protocol, hostname intersection, and allowedRoutes
namespace policy). Cross-namespace Service backends also need a Gateway API
ReferenceGrant.
Solution:
kubectl get ingressclass mikrotik- For Gateway API, confirm
gatewayAPI.enabled=trueand install the Gateway API CRDs separately. - Put HTTPRoute hostnames on the route or the Gateway listener.
- Headless Services (
clusterIP: None) and non-TCP/UDP ports are skipped.
Problem: admin UI rejects edit or delete
Symptoms:
- HTTP 409 with a
managedByobject - Edit controls disabled and a “Managed by” banner
Cause: The object is owned by a Service, Ingress, or HTTPRoute. The UI refuses mutations so generated children stay in sync with the parent.
Solution: Change the owning Kubernetes resource, not the child CR.
Problem: k3s crash-loops on WSL2
Symptoms:
- Kubelet fatal
/proc/mountsparse error mentioning/Docker/host
Cause: Docker Desktop on WSL2 exposes a 9p mount whose options contain an unescaped space.
Solution: just k3s-install applies hack/k3s-wsl-docker-desktop.sh,
which hides that mount from k3s only. just e2e-test uses k3d and is
unaffected.
Problem: chart install pulls the wrong image
Symptoms:
- Operator Pods run an unexpected tag after
helm upgrade
Cause: Chart package version and image tags are independent. An empty
image.tag uses Chart.yaml appVersion.
Solution: Pin --set image.tag=v0.4.0 (and ui.image.tag when the UI is
enabled), or set image.digest. See Install and configure.
Verification: kubectl -n mikrotik-operator-system get pods -o jsonpath='{.items[*].spec.containers[*].image}' shows the pinned tag or digest.