sematext / sematext-agent-docker

Sematext Docker Agent - host + container metrics, logs & event collector
https://sematext.com/docker
Apache License 2.0
209 stars 30 forks source link

kubernetes manifest error #8

Closed Morriz closed 8 years ago

Morriz commented 8 years ago

I believe the selector is obsolete, as I get this error:

error validating data: found invalid field selector for v1.PodSpec; if you choose to ignore these errors, turn validation off with --validate=false

But if I remove it, the DaemonSet starts without errors, but I see nothing coming in...

megastef commented 8 years ago

Which Kubernetes version do you use? Did you enter SPM App Token and Logsene Token?

megastef commented 8 years ago

This issue might be relevant: https://github.com/kubernetes/kubernetes/issues/18130 https://github.com/kubernetes/kubernetes/issues/18130#issuecomment-163022690

Please note the apiVersion changed for 1.2 see comments in my DaemonSet definition:

# Kubernetes 1.1.8
apiVersion: extensions/v1beta1
# Kubernetes 1.2
# apiVersion: v1
kind: DaemonSet
metadata:
  name: sematext-agent
spec:
  template:
    metadata:
      labels:
        app: sematext-agent
    spec:
      selector: {}
      dnsPolicy: "ClusterFirst"
      restartPolicy: "Always"
      containers:
      - name: sematext-agent
        image: sematext/sematext-agent-docker:latest
        imagePullPolicy: "Always"
        env:
        - name: SPM_TOKEN
          value: "REPLACE THIS WITH YOUR SPM TOKEN"
        - name: LOGSENE_TOKEN
          value: "REPLACE THIS WITH YOUR LOGSENE TOKEN"
        - name: KUBERNETES
          value: "1"
        volumeMounts:
          - mountPath: /var/run/docker.sock
            name: docker-sock
          - mountPath: /etc/localtime
            name: localtime
      volumes:
        - name: docker-sock
          hostPath:
            path: /var/run/docker.sock
        - name: localtime
          hostPath:
            path: /etc/localtime

Create the daemonset with kubectl create -f sematext-agent.yml --validate=false This worked at least with Kubernetes 1.1.8.

Morriz commented 8 years ago

I just migrated to 1.2.0 final and get this error: no kind "DaemonSet" is registered for version "v1"

Morriz commented 8 years ago

If I move back to extensions/v1beta1 it's fine...tnx

Morriz commented 8 years ago

However, before I got logs...now I just get metrics ;(

Morriz commented 8 years ago

maybe you are missing the udp port part

Morriz commented 8 years ago

nevermind, had to use the live streaming feature, as pressing refresh button does NOT do what it promises...it just gets what is cached in NON live mode, which is stale data...live data is running fine

otisg commented 8 years ago

@Morriz are you referring to the little refresh icon at the top of the Logsene UI? The one with 2 arrows? That one just reloads whatever query / date range / filters you've used. Clicking on one of the little "time-shortcut" icons left of that will show you the last X interval (last 10 min, last 30 min, or whatever you clicked on). The "play" icon to the right of the refresh/reload icon is for "live tail" - https://www.youtube.com/watch?v=SNzEE1weVUg

megastef commented 8 years ago
  1. Log parameters for Logsene Please note logs are buffered for bulk indexing (up to 1000 records or 30 seconds timeout). 1) You could modify the relevant parameters via environment variables: LOGSENE_LOG_INTERVAL=10000 (for 10 seconds, pls, don't get below that value it might result in http errors if our receiver starts to blog denial of service attacks ...) LOGSENE_BULK_SIZE=500 (default is 1000 records)
  2. Kubernetes DaemonSet Pleas check if the DaemonSet is enabled: For 1.1.8 it was this startup parameter for the apiserver:
--runtime-config=extensions/v1beta1/daemonsets=true

It looks Kubernetes had problems to get DaemonSets on 1.2 and they reverted a merge. Depending on the 1.2 (beta!) version you use the apiVersion might still be apiVersion: extensions/v1beta1

See here: https://github.com/kubernetes/kubernetes/commit/9a95e555ea8bfbee15fb5b830ff1884f6f0b6669#diff-4cb7085a8e1d9b8448ea3402e586181e and here: https://github.com/kubernetes/kubernetes/issues/15310 I think the best place to ask is the Kubernetes repository, or wait until 1.2 is final (including proper documentation, as far I know in 1.2 DaemonSets should be enabled by default and apiVersion will be v1).

Please note there are alternatives if you use CoreOS Sematext Agent could be deployed via fleet:

Kubernetes is a fast moving project, and as soon v1.2 (final) is released, we will provide the updated instructions.

Morriz commented 8 years ago

I have it working already, tnx. I have a bug to report tho about log output being shown differently in the sematext viewer (the kibana 4 viewer shows it ok): html chars escaped wrongly.

Where do you want me to report that?

On 18 mrt. 2016, at 09:49, Stefan Thies notifications@github.com wrote:

Log parameters for Logsene Please note logs are buffered for bulk indexing (up to 1000 records or 30 seconds timeout). 1) You could modify the relevant parameters via environment variables: LOGSENE_LOG_INTERVAL=10000 (for 10 seconds, pls, don't get below that value it might result in http errors if our receiver starts to blog denial of service attacks ...) LOGSENE_BULK_SIZE=500 (default is 1000 records)

Kubernetes DaemonSet Pleas check if the DaemonSet is enabled: For 1.1.8 it was this startup parameter for the apiserver:

--runtime-config=extensions/v1beta1/daemonsets=true It looks Kubernetes had problems to get DaemonSets on 1.2 and they reverted a merge. Depending on the 1.2 (beta!) version you use the apiVersion might still be apiVersion: extensions/v1beta1

See here: kubernetes/kubernetes@9a95e55#diff-4cb7085a8e1d9b8448ea3402e586181e https://github.com/kubernetes/kubernetes/commit/9a95e555ea8bfbee15fb5b830ff1884f6f0b6669#diff-4cb7085a8e1d9b8448ea3402e586181e and here: kubernetes/kubernetes#15310 https://github.com/kubernetes/kubernetes/issues/15310 I think the best place to ask is the Kubernetes repository, or wait until 1.2 is final (including proper documentation, as far I know in 1.2 DaemonSets should be enabled by default and apiVersion will be v1).

Please note there are alternatives if you use CoreOS Sematext Agent could be deployed via fleet:

https://github.com/sematext/sematext-agent-docker/tree/master/coreos https://github.com/sematext/sematext-agent-docker/tree/master/coreos if you run a test env with a few nodes only you might simply start the agent on each node using "docker run". Kubernetes is a fast moving project, and as soon v1.2 (final) is released, we will provide the updated instructions.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/sematext/sematext-agent-docker/issues/8#issuecomment-198260507

megastef commented 8 years ago

There is a chat window in Logsene UI (bottom right). Please report there.

otisg commented 8 years ago

Or you can email support@sematext.com. A screenshot would be very helpful in understanding this. Thanks @Morriz!

Morriz commented 8 years ago

The Kibana 4 output does not have this problem. Please see the attached screenie...

cheers,

Maurice

megastef commented 8 years ago

I close this issue, Sematext Docker Agent is working with Kuberntes 1.2. Escaping special characters in Logsene UI will be treated as Sematext Ticket and the UI fix will be in the next UI update.

megastef commented 8 years ago

A new example is here, working without --validate=false. https://github.com/sematext/sematext-agent-docker#installation-on-kubernetes https://github.com/sematext/sematext-agent-docker/blob/master/kubernetes/sematext-agent.yml