Skip to content
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

Automated cherry pick of #3107: Update coreos stack to reduce CVEs #3109

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/enterprise_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ components:
# coreos-prometheus holds the version of prometheus built for tigera/prometheus,
# which prometheus operator uses to validate.
coreos-prometheus:
version: v2.43.1
version: v2.48.1
prometheus:
image: tigera/prometheus
version: master
Expand Down
2 changes: 1 addition & 1 deletion hack/gen-versions/enterprise.go.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2023 Tigera, Inc. All rights reserved.
// Copyright (c) 2020-2024 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions pkg/components/enterprise.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2023 Tigera, Inc. All rights reserved.
// Copyright (c) 2020-2024 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -210,7 +210,7 @@ var (
}

ComponentCoreOSPrometheus = component{
Version: "v2.43.1",
Version: "v2.48.1",
Registry: "",
}

Expand Down
20 changes: 17 additions & 3 deletions pkg/render/monitor/monitor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021-2023 Tigera, Inc. All rights reserved.
// Copyright (c) 2021-2024 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,6 +32,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

v3 "github.com/tigera/api/pkg/apis/projectcalico/v3"

operatorv1 "github.com/tigera/operator/api/v1"
"github.com/tigera/operator/pkg/common"
"github.com/tigera/operator/pkg/components"
Expand Down Expand Up @@ -274,12 +275,18 @@ func (mc *monitorComponent) prometheusOperatorClusterRole() *rbacv1.ClusterRole
Resources: []string{
"alertmanagers",
"alertmanagers/finalizers",
"alertmanagers/status",
"alertmanagerconfigs",
"prometheuses",
"prometheuses/finalizers",
"prometheuses/status",
"prometheusagents",
"prometheusagents/finalizers",
"prometheusagents/status",
"thanosrulers",
"thanosrulers/finalizers",
"thanosrulers/status",
"scrapeconfigs",
"servicemonitors",
"podmonitors",
"probes",
Expand Down Expand Up @@ -316,10 +323,10 @@ func (mc *monitorComponent) prometheusOperatorClusterRole() *rbacv1.ClusterRole
"endpoints",
},
Verbs: []string{
"create",
"delete",
"get",
"create",
"update",
"delete",
},
},
{
Expand Down Expand Up @@ -348,6 +355,13 @@ func (mc *monitorComponent) prometheusOperatorClusterRole() *rbacv1.ClusterRole
"watch",
},
},
{
APIGroups: []string{"storage.k8s.io"},
Resources: []string{"storageclasses"},
Verbs: []string{
"get",
},
},
}

if mc.cfg.UsePSP {
Expand Down
25 changes: 20 additions & 5 deletions pkg/render/monitor/monitor_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021-2023 Tigera, Inc. All rights reserved.
// Copyright (c) 2021-2024 Tigera, Inc. All rights reserved.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,6 @@ import (
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/tigera/operator/pkg/ptr"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
k8sresource "k8s.io/apimachinery/pkg/api/resource"
Expand All @@ -31,7 +30,10 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/tigera/operator/pkg/ptr"

v3 "github.com/tigera/api/pkg/apis/projectcalico/v3"

operatorv1 "github.com/tigera/operator/api/v1"
"github.com/tigera/operator/pkg/apis"
"github.com/tigera/operator/pkg/common"
Expand Down Expand Up @@ -137,18 +139,24 @@ var _ = Describe("monitor rendering tests", func() {
Expect(ok).To(BeTrue())
promOperClusterRoleObj, ok := rtest.GetResource(toCreate, "calico-prometheus-operator", "", "rbac.authorization.k8s.io", "v1", "ClusterRole").(*rbacv1.ClusterRole)
Expect(ok).To(BeTrue())
Expect(promOperClusterRoleObj.Rules).To(HaveLen(9))
Expect(promOperClusterRoleObj.Rules).To(HaveLen(10))
Expect(promOperClusterRoleObj.Rules[0]).To(Equal(rbacv1.PolicyRule{
APIGroups: []string{"monitoring.coreos.com"},
Resources: []string{
"alertmanagers",
"alertmanagers/finalizers",
"alertmanagers/status",
"alertmanagerconfigs",
"prometheuses",
"prometheuses/finalizers",
"prometheuses/status",
"prometheusagents",
"prometheusagents/finalizers",
"prometheusagents/status",
"thanosrulers",
"thanosrulers/finalizers",
"thanosrulers/status",
"scrapeconfigs",
"servicemonitors",
"podmonitors",
"probes",
Expand Down Expand Up @@ -185,10 +193,10 @@ var _ = Describe("monitor rendering tests", func() {
"endpoints",
},
Verbs: []string{
"create",
"delete",
"get",
"create",
"update",
"delete",
},
}))
Expect(promOperClusterRoleObj.Rules[5]).To(Equal(rbacv1.PolicyRule{
Expand Down Expand Up @@ -218,6 +226,13 @@ var _ = Describe("monitor rendering tests", func() {
},
}))
Expect(promOperClusterRoleObj.Rules[8]).To(Equal(rbacv1.PolicyRule{
APIGroups: []string{"storage.k8s.io"},
Resources: []string{"storageclasses"},
Verbs: []string{
"get",
},
}))
Expect(promOperClusterRoleObj.Rules[9]).To(Equal(rbacv1.PolicyRule{
APIGroups: []string{"policy"},
Resources: []string{"podsecuritypolicies"},
Verbs: []string{"use"},
Expand Down
Loading