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

feat: add sane defaults to the pod and containers in pepr deployments #445

Merged
merged 11 commits into from
Jan 8, 2024
30 changes: 30 additions & 0 deletions src/lib/assets/pods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ export function watcher(assets: Assets, hash: string) {
},
spec: {
serviceAccountName: name,
securityContext: {
runAsUser: 1000,
cmwylie19 marked this conversation as resolved.
Show resolved Hide resolved
runAsGroup: 1000,
runAsNonRoot: true,
fsGroup: 1000,
},
containers: [
{
name: "watcher",
Expand Down Expand Up @@ -105,6 +111,15 @@ export function watcher(assets: Assets, hash: string) {
cpu: "500m",
},
},
securityContext: {
runAsUser: 1000,
runAsGroup: 1000,
runAsNonRoot: true,
allowPrivilegeEscalation: false,
capabilities: {
drop: ["ALL"],
},
},
volumeMounts: [
{
name: "tls-certs",
Expand Down Expand Up @@ -173,6 +188,12 @@ export function deployment(assets: Assets, hash: string): kind.Deployment {
spec: {
priorityClassName: "system-node-critical",
serviceAccountName: name,
securityContext: {
runAsUser: 1000,
runAsGroup: 1000,
runAsNonRoot: true,
fsGroup: 1000,
},
containers: [
{
name: "server",
Expand Down Expand Up @@ -209,6 +230,15 @@ export function deployment(assets: Assets, hash: string): kind.Deployment {
},
},
env: genEnv(config),
securityContext: {
runAsUser: 1000,
runAsGroup: 1000,
runAsNonRoot: true,
allowPrivilegeEscalation: false,
capabilities: {
drop: ["ALL"],
},
},
volumeMounts: [
{
name: "tls-certs",
Expand Down
Loading