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

Security Context should be configurable with Cryostat CRD #446

Closed
ebaron opened this issue Sep 6, 2022 · 0 comments · Fixed by #457
Closed

Security Context should be configurable with Cryostat CRD #446

ebaron opened this issue Sep 6, 2022 · 0 comments · Fixed by #457
Assignees
Labels
feat New feature or request needs-documentation

Comments

@ebaron
Copy link
Member

ebaron commented Sep 6, 2022

With Pod Security Admission, this is fairly important to ensure our workloads can run on a variety of clusters. It doesn't seem like one set of defaults will work for everybody.

At the API level, I expect something like the following:

type CryostatSpec struct {
// ...
	// Options to configure the Security Contexts for the Cryostat application.
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	SecurityOptions *SecurityOptions `json:"securityOptions,omitempty"`
}

type ReportConfiguration struct {
// ...
	// Options to configure the Security Contexts for the Cryostat report generator.
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	SecurityOptions *ReportsSecurityOptions `json:"securityOptions,omitempty"`
}

// SecurityOptions contains Security Context customizations for the
// main Cryostat application at both the pod and container level.
type SecurityOptions struct {
	// Security Context to apply to the Cryostat pod
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`
	// Security Context to apply to the Cryostat application container
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	CoreSecurityContext *corev1.SecurityContext `json:"coreSecurityContext,omitempty"`
	// Security Context to apply to the JFR Data Source container
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	DataSourceSecurityContext *corev1.SecurityContext `json:"dataSourceSecurityContext,omitempty"`
	// Security Context to apply to the Grafana container
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	GrafanaSecurityContext *corev1.SecurityContext `json:"grafanaSecurityContext,omitempty"`
}

// ReportsSecurityOptions contains Security Context customizations for the
// Cryostat report generator at both the pod and container level.
type ReportsSecurityOptions struct {
	// Security Context to apply to the Cryostat report generator pod
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`
	// Security Context to apply to the Cryostat report generator container
	// +optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	ReportsSecurityContext *corev1.SecurityContext `json:"reportsSecurityContext,omitempty"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request needs-documentation
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants