Enabling Access to Loki
Log into the Appliance using SSH with the username smadmin
, as described in Remote Access.
Run a kubectl command to edit the traefik deployment
kubectl edit deployments.apps -n kube-system traefik
This will bring up a view with the default file editor (vim), you will need to change the spec.template.spec.containers[0].args to match the following, adding
[--entrypoints.loki.address=:3100/tcp, --entrypoints.loki.http.tls=true]
spec:
containers:
- args:
- --entrypoints.metrics.address=:9100/tcp
- --entrypoints.out9001.address=:9001/tcp
- --entrypoints.traefik.address=:9000/tcp
- --entrypoints.web.address=:8000/tcp
- --entrypoints.websecure.address=:8443/tcp
- --api.dashboard=true
- --ping=true
- --metrics.prometheus=true
- --metrics.prometheus.entrypoint=metrics
- --providers.kubernetescrd
- --providers.kubernetesingress
- --providers.kubernetesingress.ingressendpoint.publishedservice=kube-system/traefik
- --entrypoints.websecure.http.tls=true
- --entrypoints.websecure.transport.respondingTimeouts.readTimeout=300
- --entrypoints.web.transport.respondingTimeouts.readTimeout=300
- --entrypoints.web.transport.respondingTimeouts.writeTimeout=300
- --entrypoints.websecure.transport.respondingTimeouts.writeTimeout=300
- --entrypoints.out9001.address=:9001/tcp
- --entrypoints.out9001.http.tls=true
- --providers.kubernetescrd.allowCrossNamespace=true
- --experimental.localPlugins.requestid.modulename=github.com/jrg1381/smrequestid
- --accesslog=true
- --accesslog.filepath=/tmp/access.log
- --entrypoints.loki.address=:3100/tcp
- --entrypoints.loki.http.tls=true
...
And editing spec.template.spec.containers[0].ports entry to match the following, by adding an entry for loki with port 3100 (omitting nodePort will auto-assign)
spec:
...
template:
...
spec:
containers:
- ports:
- containerPort: 9100
name: metrics
protocol: TCP
- containerPort: 9001
name: out9001
protocol: TCP
- containerPort: 9000
name: traefik
protocol: TCP
- containerPort: 8000
name: web
protocol: TCP
- containerPort: 8443
name: websecure
protocol: TCP
- containerPort: 3100
name: loki
protocol: TCP
...
A similar process needs to be applied to the traefik service
kubectl edit service -n kube-system traefik
Edit spec.ports to match the following.
...
spec:
ports:
- name: out9001
nodePort: 31800
port: 9001
protocol: TCP
targetPort: out9001
- name: web
nodePort: 30669
port: 80
protocol: TCP
targetPort: web
- name: websecure
nodePort: 31984
port: 443
protocol: TCP
targetPort: websecure
- name: loki
port: 3100
protocol: TCP
targetPort: loki
...