Skip to content

Commit

Permalink
format log level, annotate pod, rollout deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
hans-m-song committed Jul 13, 2024
1 parent e7012cb commit 0adb2aa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,10 @@ jobs:
environment: production

steps:
- name: Upgrade helm chart
id: deploy
run: |
helm repo add huisheng https://huisheng.charts.axatol.xyz
helm repo update
helm upgrade huisheng huisheng/huisheng \
--install \
--create-namespace \
--namespace huisheng \
--atomic \
--reuse-values
- uses: axatol/actions/rollout-kubernetes-deployment@release
with:
namespace: huisheng
deployment-name: huisheng

- name: Create deployment marker
if: success()
Expand Down
9 changes: 9 additions & 0 deletions charts/huisheng/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
labels: {{ include "huisheng.selectorLabels" . | nindent 8 }}
annotations:
credentials/checksum: {{ include (print $.Template.BasePath "/credentials.yaml") . | sha256sum }}
{{- range $key, $value := range .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
containers:
- name: huisheng
Expand All @@ -32,7 +35,13 @@ spec:
value: {{ $value | toString | quote }}
{{- end }}
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 10000
runAsGroup: 10000
readOnlyRootFilesystem: true
capabilities:
drop: [ALL]
add: [SYS_NICE]
volumeMounts:
- name: data
Expand Down
2 changes: 2 additions & 0 deletions charts/huisheng/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
image: public.ecr.aws/axatol/huisheng:latest
imagePullPolicy: Always

podAnnotations: {}

env:
{}
# DEBUG:
Expand Down
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export const log = pino({
transport:
config.logFormat == 'text' ? { target: 'pino-pretty', options: { colorize: true } } : undefined,
level: config.logLevel,
formatters: {
level: (label, _number) => ({ level: label }),
},
serializers: {
error: (error: any): any => {
if (
Expand Down

0 comments on commit 0adb2aa

Please sign in to comment.