SumoLogic / sumologic-kubernetes-collection

Sumo Logic collection solution for Kubernetes
Apache License 2.0
147 stars 184 forks source link

sumologic-collector-setup job fails with collector not found error. #414

Closed spat1492 closed 4 years ago

spat1492 commented 4 years ago
curl -s https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/v0.13.0/deploy/kubernetes/setup-sumologic.yaml.tmpl | \
sed 's/\$NAMESPACE'"/sumologic/g" |
sed 's/\$SUMOLOGIC_ACCESSID'"/<SUMOLOGIC_ACCESSID>/g" | 
sed 's/\$SUMOLOGIC_ACCESSKEY'"/<SUMOLOGIC_ACCESSKEY>/g" | 
sed 's/\$COLLECTOR_NAME'"/collector/g" | 
sed 's/\$CLUSTER_NAME'"/<my-aks-cluster-name>/g" | 
tee setup-sumologic.yaml | 
kubectl -n sumologic apply -f -

I ran the above command with the appropriate values as shown above. The job starts but quickly fails with the following error.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
sumologic_collector.collector: Importing from ID "collector"...
sumologic_collector.collector: Import prepared!
  Prepared sumologic_collector for import
sumologic_collector.collector: Refreshing state... [id=collector]

Error: collector with name 'collector' does not exist


sumologic_http_source.default_metrics_source: Importing from ID "collector/(default-metrics)"...

Error: collector with name 'collector' does not exist


sumologic_http_source.apiserver_metrics_source: Importing from ID "collector/apiserver-metrics"...

Based on this part of the documentation:

It will create Kubernetes resources in your environment and run a container that uses the Sumo Logic Terraform provider to create a Hosted Collector and multiple HTTP Sources in Sumo.

It is my understanding that this job is to supposed to create a controller with the name we have passed in as a parameter? If this assumption is incorrect -- what is the recommended process for creating this controller?

I am currently trying the non-helm installation. But when using helm the job fails with the same error.

This lead me to believe the issue might might have been with the sumologic endpoint, https://api.sumologic.com/api, I have provided but upon curling to the end point does not return errors. [actually it does not return anything]

Might anyone be able to provide any hints as to what might be going wrong?

rvmiller89 commented 4 years ago

@spat1492 is there any more to the logs generated by the setup container? The errors you see are expected as it first tries to import the collector and sources if they already exist. Otherwise it will proceed to create them. So after the import steps there should be more logs that may indicate what went wrong.

spat1492 commented 4 years ago

Error: <!DOCTYPE html>

Sumo Logic