Skip to content

Commit

Permalink
upgrade es and kb to version 8
Browse files Browse the repository at this point in the history
  • Loading branch information
vara2504 committed Nov 19, 2024
1 parent 1f9a7a9 commit af72eab
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 49 deletions.
4 changes: 2 additions & 2 deletions config/enterprise_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ components:
image: tigera/dex
version: master
eck-kibana:
version: 7.17.25
version: 8.15.3
kibana:
image: tigera/kibana
version: master
eck-elasticsearch:
version: 7.17.25
version: 8.15.3
elasticsearch:
image: tigera/elasticsearch
version: master
Expand Down
4 changes: 2 additions & 2 deletions pkg/components/enterprise.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ var (
}

ComponentEckElasticsearch = Component{
Version: "7.17.25",
Version: "8.15.3",
Registry: "",
}

ComponentEckKibana = Component{
Version: "7.17.25",
Version: "8.15.3",
Registry: "",
}

Expand Down
23 changes: 11 additions & 12 deletions pkg/render/logstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"github.com/tigera/operator/pkg/common"
"github.com/tigera/operator/pkg/components"
"github.com/tigera/operator/pkg/dns"
"github.com/tigera/operator/pkg/ptr"
relasticsearch "github.com/tigera/operator/pkg/render/common/elasticsearch"
rmeta "github.com/tigera/operator/pkg/render/common/meta"
"github.com/tigera/operator/pkg/render/common/networkpolicy"
Expand Down Expand Up @@ -358,15 +359,10 @@ func (es *elasticsearchComponent) podTemplate() corev1.PodTemplateSpec {
},
}

sc := securitycontext.NewRootContext(false)
// These capabilities are required for docker-entrypoint.sh.
// See: https://github.com/elastic/elasticsearch/blob/7.17/distribution/docker/src/docker/bin/docker-entrypoint.sh.
// TODO Consider removing for Elasticsearch v8+.
sc.Capabilities.Add = []corev1.Capability{
"SETGID",
"SETUID",
"SYS_CHROOT",
}
sc := securitycontext.NewNonRootContext()
// Set the user and group to be the default elasticsearch ID
sc.RunAsUser = ptr.Int64ToPtr(1000)
sc.RunAsGroup = ptr.Int64ToPtr(1000)

esContainer := corev1.Container{
Name: "elasticsearch",
Expand Down Expand Up @@ -717,9 +713,12 @@ func (es *elasticsearchComponent) nodeSets() []esv1.NodeSet {
// NodeSet
func (es *elasticsearchComponent) nodeSetTemplate(pvcTemplate corev1.PersistentVolumeClaim) esv1.NodeSet {
config := map[string]interface{}{
"node.master": "true",
"node.data": "true",
"node.ingest": "true",
"node.roles": []string{
"data",
"ingest",
"master",
"remote_cluster_client",
},
"cluster.max_shards_per_node": 10000,
// Disable geoip downloader. This removes an error from the startup logs, because our network policy blocks it.
"ingest.geoip.downloader.enabled": false,
Expand Down
55 changes: 22 additions & 33 deletions pkg/render/logstorage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,12 @@ var _ = Describe("Elasticsearch rendering tests", func() {
esContainer := resultES.Spec.NodeSets[0].PodTemplate.Spec.Containers[0]
Expect(*esContainer.SecurityContext.AllowPrivilegeEscalation).To(BeFalse())
Expect(*esContainer.SecurityContext.Privileged).To(BeFalse())
Expect(*esContainer.SecurityContext.RunAsGroup).To(BeEquivalentTo(0))
Expect(*esContainer.SecurityContext.RunAsNonRoot).To(BeFalse())
Expect(*esContainer.SecurityContext.RunAsUser).To(BeEquivalentTo(0))
Expect(*esContainer.SecurityContext.RunAsGroup).To(BeEquivalentTo(1000))
Expect(*esContainer.SecurityContext.RunAsNonRoot).To(BeTrue())
Expect(*esContainer.SecurityContext.RunAsUser).To(BeEquivalentTo(1000))
Expect(esContainer.SecurityContext.Capabilities).To(Equal(
&corev1.Capabilities{
Drop: []corev1.Capability{"ALL"},
Add: []corev1.Capability{"SETGID", "SETUID", "SYS_CHROOT"},
},
))
Expect(esContainer.SecurityContext.SeccompProfile).To(Equal(
Expand All @@ -242,9 +241,7 @@ var _ = Describe("Elasticsearch rendering tests", func() {

// Check that the expected config made it's way to the Elastic CR
Expect(nodeSet.Config.Data).Should(Equal(map[string]interface{}{
"node.master": "true",
"node.data": "true",
"node.ingest": "true",
"node.roles": []string{"data", "ingest", "master", "remote_cluster_client"},
"cluster.max_shards_per_node": 10000,
"ingest.geoip.downloader.enabled": false,
}))
Expand Down Expand Up @@ -970,12 +967,10 @@ var _ = Describe("Elasticsearch rendering tests", func() {
},
}))
Expect(nodeSets[0].Config.Data).Should(Equal(map[string]interface{}{
"node.master": "true",
"node.data": "true",
"node.ingest": "true",
"cluster.max_shards_per_node": 10000,
"ingest.geoip.downloader.enabled": false,
"node.attr.zone": "us-west-2a",
"node.roles": []string{"data", "ingest", "master", "remote_cluster_client"},
"cluster.max_shards_per_node": 10000,
"ingest.geoip.downloader.enabled": false,
"node.attr.zone": "us-west-2a",
"cluster.routing.allocation.awareness.attributes": "zone",
}))

Expand All @@ -991,12 +986,10 @@ var _ = Describe("Elasticsearch rendering tests", func() {
},
}))
Expect(nodeSets[1].Config.Data).Should(Equal(map[string]interface{}{
"node.master": "true",
"node.data": "true",
"node.ingest": "true",
"cluster.max_shards_per_node": 10000,
"ingest.geoip.downloader.enabled": false,
"node.attr.zone": "us-west-2b",
"node.roles": []string{"data", "ingest", "master", "remote_cluster_client"},
"cluster.max_shards_per_node": 10000,
"ingest.geoip.downloader.enabled": false,
"node.attr.zone": "us-west-2b",
"cluster.routing.allocation.awareness.attributes": "zone",
}))
})
Expand Down Expand Up @@ -1063,13 +1056,11 @@ var _ = Describe("Elasticsearch rendering tests", func() {
},
}))
Expect(nodeSets[0].Config.Data).Should(Equal(map[string]interface{}{
"node.master": "true",
"node.data": "true",
"node.ingest": "true",
"cluster.max_shards_per_node": 10000,
"ingest.geoip.downloader.enabled": false,
"node.attr.zone": "us-west-2a",
"node.attr.rack": "rack1",
"node.roles": []string{"data", "ingest", "master", "remote_cluster_client"},
"cluster.max_shards_per_node": 10000,
"ingest.geoip.downloader.enabled": false,
"node.attr.zone": "us-west-2a",
"node.attr.rack": "rack1",
"cluster.routing.allocation.awareness.attributes": "zone,rack",
}))

Expand All @@ -1094,13 +1085,11 @@ var _ = Describe("Elasticsearch rendering tests", func() {
},
}))
Expect(nodeSets[1].Config.Data).Should(Equal(map[string]interface{}{
"node.master": "true",
"node.data": "true",
"node.ingest": "true",
"cluster.max_shards_per_node": 10000,
"ingest.geoip.downloader.enabled": false,
"node.attr.zone": "us-west-2b",
"node.attr.rack": "rack1",
"node.roles": []string{"data", "ingest", "master", "remote_cluster_client"},
"cluster.max_shards_per_node": 10000,
"ingest.geoip.downloader.enabled": false,
"node.attr.zone": "us-west-2b",
"node.attr.rack": "rack1",
"cluster.routing.allocation.awareness.attributes": "zone,rack",
}))
})
Expand Down

0 comments on commit af72eab

Please sign in to comment.