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

Align helm chart with best practises #8

Open
samuel-lindgren opened this issue Jan 27, 2025 · 0 comments
Open

Align helm chart with best practises #8

samuel-lindgren opened this issue Jan 27, 2025 · 0 comments

Comments

@samuel-lindgren
Copy link

samuel-lindgren commented Jan 27, 2025

The chart currently does not incorporate several recommended best practices such as:

  • imagePullSecrets: allowing the image to be hosted and pulled from a private registry
  • securityContext: enabling containers run as non-root and follow principle of least privilege
  • affinity for controlling pod placement.
  • tolerations: for scheduling pods to tolerate specific conditions.
  • use gRPC where possible: prefer to use gRPC over TChannel(RPC) due to it being more standardized.

Inspiration
Banzai:

Temporal:

gRPC:

  • One approach could be to use grpc-rpc like Temporal's server-service.yaml
  • Another approach could be to use gRPC strictly where possible as shown in below code (from our fork):
{{- range $service := (list "frontend" "matching" "history" "worker") }}
{{- $serviceValues := index $.Values.server $service -}}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "cadence.componentname" (list $ (printf "%s-headless" $service)) }}
  labels: # labels
  annotations: #annotations
spec:
  type: ClusterIP
  clusterIP: None
  publishNotReadyAddresses: true
  ports:
    - port: {{ $serviceValues.service.port }}
      targetPort: rpc
      protocol: TCP
      name: rpc
    {{- /*
       All services but the worker have a gRPC port.
    */ -}}
    {{- if (ne $service "worker") }}
    - port: {{ $serviceValues.service.grpcPort }}
      targetPort: grpc
      protocol: TCP
      name: grpc
    {{- end }}
    {{- if $.Values.metricsEnabled }}
    - name: metrics
      port: {{ $.Values.services.metrics.port }}
      targetPort: metrics
      protocol: TCP
    {{- end }}
  selector:
    app.kubernetes.io/name: {{ include "cadence.name" $ }}
    app.kubernetes.io/instance: {{ $.Release.Name }}
    app.kubernetes.io/component: {{ $service }}

---
{{- end }} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant