-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate splunk monitoring console app for indexer clustering #135
Conversation
ee8c45e
to
c04d58a
Compare
pkg/splunk/enterprise/util.go
Outdated
if spec.ClusterMasterRef.Namespace != "" { | ||
clusterMasterURL = splcommon.GetServiceFQDN(spec.ClusterMasterRef.Namespace, clusterMasterURL) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need an additional conditional check here, just to make sure that the current CRs namespace same as the ClusterMasterRef. If there is a mismatch, we should not proceed here... Thoughts?
Also, GetServiceFQDN is not an option here, and it should be the Master URL always?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will namespace similar to ClusterMasterRef? We can actually use any valid service/URL name or pod name, we just need valid service where we can connect to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we supporting the case of indexers in one namespace and CM in another namespace? If so, how are we dealing with the two MCs in different namespaces? Are we officially supporting the deployments across the namespaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No,I dont think so we are supporting indexers in a different namespace than CM. Check validateIndexerClusterSpec
.
func validateIndexerClusterSpec(cr *enterprisev1.IndexerCluster) error {
// We cannot have 0 replicas in IndexerCluster spec, since this refers to number of indexers in an indexer cluster
if cr.Spec.Replicas == 0 {
cr.Spec.Replicas = 1
}
// Cannot leave clusterMasterRef field empty or else we cannot connect to CM
if len(cr.Spec.ClusterMasterRef.Name) == 0 {
return fmt.Errorf("IndexerCluster spec should refer to ClusterMaster via clusterMasterRef")
}
// Multisite / multipart clusters: can't reference a cluster master located in another namespace because of Service and Secret limitations
if len(cr.Spec.ClusterMasterRef.Namespace) > 0 && cr.Spec.ClusterMasterRef.Namespace != cr.GetNamespace() {
return fmt.Errorf("Multisite cluster does not support cluster master to be located in a different namespace")
}
return validateCommonSplunkSpec(&cr.Spec.CommonSplunkSpec)
}
licenseMasterURL := GetSplunkServiceName(SplunkLicenseMaster, spec.LicenseMasterRef.Name, false) | ||
if spec.LicenseMasterRef.Namespace != "" { | ||
licenseMasterURL = splcommon.GetServiceFQDN(spec.LicenseMasterRef.Namespace, licenseMasterURL) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the case of Licence Master. I may be missing something here, but please let me know if we don't need FQDN in a certain cases?
Wondering how this is different from a case when we are dealing with the REST calls..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For rest calls we are using fqdn service, For license master, we are not using it anywhere. This is just for MC to add LM as its peer
pkg/splunk/enterprise/util.go
Outdated
if spec.ClusterMasterRef.Namespace != "" { | ||
clusterMasterURL = splcommon.GetServiceFQDN(spec.ClusterMasterRef.Namespace, clusterMasterURL) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will namespace similar to ClusterMasterRef? We can actually use any valid service/URL name or pod name, we just need valid service where we can connect to
a93ed4a
to
4c5ee96
Compare
…ger array from string. Adding logging if len(apiresponse.Entry)<1
4c5ee96
to
d7ddda6
Compare
pkg/splunk/enterprise/util.go
Outdated
if spec.ClusterMasterRef.Namespace != "" { | ||
clusterMasterURL = splcommon.GetServiceFQDN(spec.ClusterMasterRef.Namespace, clusterMasterURL) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No,I dont think so we are supporting indexers in a different namespace than CM. Check validateIndexerClusterSpec
.
func validateIndexerClusterSpec(cr *enterprisev1.IndexerCluster) error {
// We cannot have 0 replicas in IndexerCluster spec, since this refers to number of indexers in an indexer cluster
if cr.Spec.Replicas == 0 {
cr.Spec.Replicas = 1
}
// Cannot leave clusterMasterRef field empty or else we cannot connect to CM
if len(cr.Spec.ClusterMasterRef.Name) == 0 {
return fmt.Errorf("IndexerCluster spec should refer to ClusterMaster via clusterMasterRef")
}
// Multisite / multipart clusters: can't reference a cluster master located in another namespace because of Service and Secret limitations
if len(cr.Spec.ClusterMasterRef.Namespace) > 0 && cr.Spec.ClusterMasterRef.Namespace != cr.GetNamespace() {
return fmt.Errorf("Multisite cluster does not support cluster master to be located in a different namespace")
}
return validateCommonSplunkSpec(&cr.Spec.CommonSplunkSpec)
}
23f3754
to
42aa4b7
Compare
Automate Splunk monitoring console app for indexer clustering