Skip to content

Commit 2f2229d

Browse files
tylerohlsendecyjphrCopilot
authored
Change helm defaults to be more newcomer friendly (#919)
* Updated container port to match the port exposed by the application inside the container * Added examples for common environment variables * Changed validators to be examples in comments to avoid needing to override * Changed min replica count to 1 for more cost effective defaults * Updated min replica default in docs * Updated service port default in docs * Updated validator defaults in docs * Updated restricted repos include default in docs * Update helm/safe-settings/values.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update helm/safe-settings/values.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Updated README to match the new default value Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Yadhav Jayaraman <57544838+decyjphr@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 11f29c9 commit 2f2229d

File tree

3 files changed

+53
-40
lines changed

3 files changed

+53
-40
lines changed

helm/safe-settings/README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,15 @@ A Helm chart for Kubernetes
99
| affinity | object | `{}` | |
1010
| autoscaling.enabled | bool | `false` | |
1111
| autoscaling.maxReplicas | int | `10` | |
12-
| autoscaling.minReplicas | int | `2` | |
12+
| autoscaling.minReplicas | int | `1` | |
1313
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
14-
| deploymentConfig.configvalidators[0].error | string | `"`Admin cannot be assigned to collaborators`\n"` | |
15-
| deploymentConfig.configvalidators[0].plugin | string | `"collaborators"` | |
16-
| deploymentConfig.configvalidators[0].script | string | `"console.log(`baseConfig ${JSON.stringify(baseconfig)}`)\nreturn baseconfig.permission != 'admin'\n"` | |
17-
| deploymentConfig.overridevalidators[0].error | string | `"`Branch protection required_approving_review_count cannot be overidden to a lower value`\n"` | |
18-
| deploymentConfig.overridevalidators[0].plugin | string | `"branches"` | |
19-
| deploymentConfig.overridevalidators[0].script | string | `"console.log(`baseConfig ${JSON.stringify(baseconfig)}`)\nconsole.log(`overrideConfig ${JSON.stringify(overrideconfig)}`)\nif (baseconfig.protection.required_pull_request_reviews.required_approving_review_count && overrideconfig.protection.required_pull_request_reviews.required_approving_review_count ) {\n return overrideconfig.protection.required_pull_request_reviews.required_approving_review_count >= baseconfig.protection.required_pull_request_reviews.required_approving_review_count\n}\nreturn true\n"` | |
20-
| deploymentConfig.overridevalidators[1].error | string | `"Some error\n"` | |
21-
| deploymentConfig.overridevalidators[1].plugin | string | `"labels"` | |
22-
| deploymentConfig.overridevalidators[1].script | string | `"return true\n"` | |
14+
| deploymentConfig.configvalidators | list | [] | |
15+
| deploymentConfig.overridevalidators | list | [] | |
2316
| deploymentConfig.restrictedRepos.exclude[0] | string | `"^admin$"` | |
2417
| deploymentConfig.restrictedRepos.exclude[1] | string | `"^\\.github$"` | |
2518
| deploymentConfig.restrictedRepos.exclude[2] | string | `"^safe-settings$"` | |
2619
| deploymentConfig.restrictedRepos.exclude[3] | string | `".*-test"` | |
27-
| deploymentConfig.restrictedRepos.include[0] | string | `"^test$"` | |
20+
| deploymentConfig.restrictedRepos.include | null | `null` | |
2821
| env | list | `[]` | |
2922
| envFrom | list | `[]` | |
3023
| extraObjects | list | `[]` | Add dynamic manifests via values. Example: extraObjects: - kind: ConfigMap apiVersion: v1 metadata: name: extra-cm-{{ .Release.Name }} data: | extra.yml: "does-my-install-need-extra-info: true" |
@@ -44,15 +37,15 @@ A Helm chart for Kubernetes
4437
| nodeSelector | object | `{}` | |
4538
| podAnnotations | object | `{}` | |
4639
| podSecurityContext | object | `{}` | |
47-
| replicaCount | int | `2` | |
40+
| replicaCount | int | `1` | |
4841
| resources | object | `{}` | |
4942
| securityContext.allowPrivilegeEscalation | bool | `false` | |
5043
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
5144
| securityContext.privileged | bool | `false` | |
5245
| securityContext.readOnlyRootFilesystem | bool | `true` | |
5346
| securityContext.runAsNonRoot | bool | `true` | |
5447
| securityContext.runAsUser | int | `1000` | |
55-
| service.port | int | `80` | |
48+
| service.port | int | `3000` | |
5649
| service.type | string | `"ClusterIP"` | |
5750
| serviceAccount.annotations | object | `{}` | |
5851
| serviceAccount.automountServiceAccountToken | bool | `false` | |

helm/safe-settings/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ spec:
4343
{{- end }}
4444
ports:
4545
- name: http
46-
containerPort: {{ .Values.service.port }}
46+
containerPort: 3000
4747
protocol: TCP
4848
resources:
4949
{{- toYaml .Values.resources | nindent 12 }}

helm/safe-settings/values.yaml

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5-
replicaCount: 2
5+
replicaCount: 1
66

77
image:
88
repository: ghcr.io/github/safe-settings
@@ -45,6 +45,26 @@ envFrom: []
4545
# name: app-env
4646

4747
env: []
48+
# - name: CRON
49+
# value: '*/5 * * * *'
50+
# - name: APP_ID
51+
# valueFrom:
52+
# secretKeyRef:
53+
# name: github_app_secret
54+
# key: app_id
55+
# optional: false
56+
# - name: PRIVATE_KEY
57+
# valueFrom:
58+
# secretKeyRef:
59+
# name: github_app_secret
60+
# key: private_key
61+
# optional: false
62+
# - name: WEBHOOK_SECRET
63+
# valueFrom:
64+
# secretKeyRef:
65+
# name: github_app_secret
66+
# key: webhook_secret
67+
# optional: false
4868

4969
service:
5070
type: ClusterIP
@@ -83,7 +103,7 @@ resources:
83103

84104
autoscaling:
85105
enabled: false
86-
minReplicas: 2
106+
minReplicas: 1
87107
maxReplicas: 10
88108
targetCPUUtilizationPercentage: 80
89109
# targetMemoryUtilizationPercentage: 80
@@ -104,30 +124,30 @@ deploymentConfig:
104124
# If no file is specified, then the following repositories - 'admin', '.github', 'safe-settings' are exempted by default
105125
exclude: ["^admin$", '^\.github$', "^safe-settings$", ".*-test"]
106126
# Alternatively you can only include certain repos
107-
include: ["^test$"]
108-
configvalidators:
109-
- plugin: collaborators
110-
error: |
111-
`Admin cannot be assigned to collaborators`
112-
script: |
113-
console.log(`baseConfig ${JSON.stringify(baseconfig)}`)
114-
return baseconfig.permission != 'admin'
115-
overridevalidators:
116-
- plugin: branches
117-
error: |
118-
`Branch protection required_approving_review_count cannot be overidden to a lower value`
119-
script: |
120-
console.log(`baseConfig ${JSON.stringify(baseconfig)}`)
121-
console.log(`overrideConfig ${JSON.stringify(overrideconfig)}`)
122-
if (baseconfig.protection.required_pull_request_reviews.required_approving_review_count && overrideconfig.protection.required_pull_request_reviews.required_approving_review_count ) {
123-
return overrideconfig.protection.required_pull_request_reviews.required_approving_review_count >= baseconfig.protection.required_pull_request_reviews.required_approving_review_count
124-
}
125-
return true
126-
- plugin: labels
127-
error: |
128-
Some error
129-
script: |
130-
return true
127+
include: null # ["^test$"]
128+
configvalidators: []
129+
# - plugin: collaborators
130+
# error: |
131+
# `Admin cannot be assigned to collaborators`
132+
# script: |
133+
# console.log(`baseConfig ${JSON.stringify(baseconfig)}`)
134+
# return baseconfig.permission != 'admin'
135+
overridevalidators: []
136+
# - plugin: branches
137+
# error: |
138+
# `Branch protection required_approving_review_count cannot be overridden to a lower value`
139+
# script: |
140+
# console.log(`baseConfig ${JSON.stringify(baseconfig)}`)
141+
# console.log(`overrideConfig ${JSON.stringify(overrideconfig)}`)
142+
# if (baseconfig.protection.required_pull_request_reviews.required_approving_review_count && overrideconfig.protection.required_pull_request_reviews.required_approving_review_count ) {
143+
# return overrideconfig.protection.required_pull_request_reviews.required_approving_review_count >= baseconfig.protection.required_pull_request_reviews.required_approving_review_count
144+
# }
145+
# return true
146+
# - plugin: labels
147+
# error: |
148+
# Some error
149+
# script: |
150+
# return true
131151

132152
# -- Add dynamic manifests via values. Example:
133153
# extraObjects:

0 commit comments

Comments
 (0)