Are there any issues with running multiple replica...
# ory-selfhosting
b
Are there any issues with running multiple replicas of Keto for High availability on K8s? Can I just edit the helm values to bringup 2 replicas?
t
Yep, it'll work fine, you just need to set
replicaCount
in you helm values, or enable autoscaling with something like the below
Copy code
deployment:
  autoscaling:
    enabled: true
    minReplicas: 3
If High Availability is the goal, you'll probably also want to define
affinity
rules too
b
Awesome. Thanks. Are there special considerations for affinity rules over replica count?
t
They should be used independently rather either or. The affinity rules would be to just ensure you don't schedule all your Keto pods on a single node, or zone, giving better high availability
b
Thanks @tall-angle-41306
🙇 1
t
Which cloud provider are you running on?
b
Using EKS from AWS
t
This should work for EKS:
Copy code
affinity:
  podAntiAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    - labelSelector:
        matchExpressions:
        - key: <http://app.kubernetes.io/instance|app.kubernetes.io/instance>
          operator: In
          values:
          - keto
      topologyKey: <http://kubernetes.io/hostname|kubernetes.io/hostname>
    preferredDuringSchedulingIgnoredDuringExecution:
    - weight: 100
      podAffinityTerm:
        labelSelector:
        - key: <http://app.kubernetes.io/instance|app.kubernetes.io/instance>
          operator: In
          values:
          - keto
        topologyKey: <http://topology.kubernetes.io/zone|topology.kubernetes.io/zone>
The above will ensure your Keto pods don't share the same node, and will prefer (but not require) to be split across any of your zones
May need to check the topologyKeys match your environment, I've just pulled them from the EKS docs
b
Thanks @tall-angle-41306 Will try this out