Raw Example

sxcollector can be deployed in every kubernetes cluster using the raw file.

Requirements

Connect to your kubernetes cluster

Kubernetes cluster

kubectl \
   config set-credentials \
   mycluster/myuser \
   --username=kubeuser \
   --password=kubepassword
kubectl \
   config set-cluster \
   mycluster \
   --insecure-skip-tls-verify=true \
   --server=https://mycluster.kubernetes.com
kubectl \
   config set-cluster \
   mycluster \
   --insecure-skip-tls-verify=true \
   --server=https://mycluster.kubernetes.com
kubectl \
   config set-context \
   mycluster/myuser \
   --user=mycluster/myuser \
   --namespace=default \
   --cluster=mycluster
kubectl \
   config use-context \
   mycluster/myuser

Openshift cluster

oc login  \
   --username=kubeuser \
   --password=kubepassword \
   https://mycluster.openshift.com

Default

You can change the default kubeconfig using environment variable

export KUBECONFIG=/home/user/mykubeconfig

By default the /home/user/.kube/config file will be used. ensure that the default context is connected and can interact with a kubernetes cluster.

Deploy SXCollector

export BASE_URL=https://gitlab.com/startx1/k8s/sxcollector/-/raw/main/docs/examples/raw
kubectl apply -f ${BASE_URL}/full.yaml

create the following components :

  • namespace : sxcollector
  • serviceaccount : sxcollector in sxcollector NS
  • imagestream : sxcollector in sxcollector NS
  • clusterRoleBinding : sxcollector-cluster-admin enable ServiceAccount sxcollector in sxcollector NS to be cluster-admin
  • secret : sxcollector
  • jobs : node-info-instant in sxcollector NS
  • jobs : ns-info-instant in sxcollector NS
  • cronjobs : node-conso-monthly in sxcollector NS
  • cronjobs : ns-state-hourly in sxcollector NS
  • cronjobs : cluster-sub-monthly in sxcollector NS
  • cronjobs : node-state-hourly in sxcollector NS
  • cronjobs : node-billing-monthly in sxcollector NS
  • cronjobs : ns-conso-weekly in sxcollector NS
  • deployment : sxcollector-debug