Part 5: Production Best Practices and Security
Introduction
Secrets Management
Kubernetes Secrets
{{- if .Values.secrets.create }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "typescript-api.fullname" . }}-secrets
labels:
{{- include "typescript-api.labels" . | nindent 4 }}
type: Opaque
data:
{{- if .Values.secrets.databasePassword }}
database-password: {{ .Values.secrets.databasePassword | b64enc | quote }}
{{- else }}
# Generate random password if not provided
database-password: {{ randAlphaNum 32 | b64enc | quote }}
{{- end }}
{{- if .Values.secrets.apiKey }}
api-key: {{ .Values.secrets.apiKey | b64enc | quote }}
{{- else }}
api-key: {{ randAlphaNum 64 | b64enc | quote }}
{{- end }}
{{- if .Values.secrets.jwtSecret }}
jwt-secret: {{ .Values.secrets.jwtSecret | b64enc | quote }}
{{- else }}
jwt-secret: {{ randAlphaNum 128 | b64enc | quote }}
{{- end }}
{{- end }}Helm Secrets Plugin
External Secrets Operator
Security Best Practices
Pod Security Context
Network Policies
Service Account with RBAC
Testing Charts
Helm Lint
Template Validation
Chart Testing (ct)
Unit Testing with Helm-unittest
Rollback Strategies
Release History
Rollback Operations
Pre-Upgrade Hooks
CI/CD Integration
GitHub Actions Workflow
GitLab CI/CD
Performance Optimization
Resource Management
Horizontal Pod Autoscaling
Pod Disruption Budgets
Troubleshooting
Release Stuck
Failed Upgrades
Debug Template Issues
Production Checklist
Conclusion
Additional Resources
Key Takeaways
Last updated