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 1 commit
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 pkg/components/enterprise.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ var (
}

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

Expand Down
18 changes: 16 additions & 2 deletions pkg/render/monitor/monitor.go
Original file line number Diff line number Diff line change
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
23 changes: 19 additions & 4 deletions pkg/render/monitor/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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