Automated deployment

Run the automated deployment script
bash <(curl -s https://raw.githubusercontent.com/logzio/logz-docs/master/shipping-config-samples/quickstart.sh)
Prompts and answers
Prompt Description
Logz.io metrics shipping token The token of the account you want to ship to.
Logz.io region Two-letter region code, or blank for US East (Northern Virginia). This determnies your listener URL (where you’re shipping the logs to) and API URL.
You can find your region code in the Regions and URLs table.
Kubelet shipping protocol http http or https. If your Kubernetes setup is EKS, you’ll need to use https.
Cluster name Detected by the script The name of the Kubernetes cluster you’re deploying in.
Check Logz.io for your metrics

Give your metrics some time to get from your system to ours, and then open Logz.io.

Manual deployment

Check for kube-state-metrics in your cluster
kubectl get pods --all-namespaces | grep kube-state-metrics

If you see a response, that means kube-state-metrics is installed, and you can move on to step 2.

Otherwise, deploy kube-state-metrics to your cluster.

git clone https://github.com/kubernetes/kube-state-metrics.git \
  && kubectl --namespace=kube-system apply -f kube-state-metrics/examples/standard
Store your Logz.io credentials

Save your Logz.io shipping credentials as a Kubernetes secret.

Replace <<SHIPPING-TOKEN>> with the token of the account you want to ship to.

Replace <<LISTENER-HOST>> with your region’s listener host (for example, listener.logz.io). For more information on finding your account’s region, see Account region.

kubectl --namespace=kube-system create secret generic logzio-metrics-secret \
  --from-literal=logzio-metrics-shipping-token=<<SHIPPING-TOKEN>> \
  --from-literal=logzio-metrics-listener-host=<<LISTENER-HOST>>
Store your cluster details

Paste the kube-state-metrics namespace and port in your text editor. You can find them by running this command.

kubectl get service --all-namespaces | grep -E 'kube-state-metrics|NAMESPACE'

Paste the cluster name in your text editor. You can find it by running this command, or if you manage Kubernetes in AWS or Azure, you can find it in your admin console.

kubectl cluster-info

Now replace <<KUBE-STATE-METRICS-NAMESPACE>>, <<KUBE-STATE-METRICS-PORT>>, and <<CLUSTER-NAME>> in this command to save your cluster details as a Kubernetes secret.

kubectl --namespace=kube-system create secret generic cluster-details \
  --from-literal=kube-state-metrics-namespace=<<KUBE-STATE-METRICS-NAMESPACE>> \
  --from-literal=kube-state-metrics-port=<<KUBE-STATE-METRICS-PORT>> \
  --from-literal=cluster-name=<<CLUSTER-NAME>>
Deploy

Deploy one of these configurations.

If your Kubernetes setup is EKS, you’ll need to use the HTTPS deployment.

For HTTP communication with kubelet
kubectl --namespace=kube-system create -f https://raw.githubusercontent.com/logzio/logz-docs/master/shipping-config-samples/k8s-metricbeat-http.yml
...Or for HTTPS communication with kubelet

If you want your internal kubelet communication over HTTPs, make sure you update your CA certificate accordingly.

kubectl --namespace=kube-system create -f https://raw.githubusercontent.com/logzio/logz-docs/master/shipping-config-samples/k8s-metricbeat-https.yml
Check Logz.io for your metrics

Give your metrics some time to get from your system to ours, and then open Logz.io.