GithubHelp home page GithubHelp logo

Comments (6)

s3than avatar s3than commented on July 23, 2024 2

@mitchellh Is there anything I can provide to get this item resolved?

Making affinity a variable allows testing on Minikube

Thanks

from consul-helm.

kohv avatar kohv commented on July 23, 2024

I had to remove affinity rules on the StatefulSet, here

After removing that anti-affinity rule, I was able to successfully launch consul server & consul-ui. I'm very new to k8s, but it seems to me that the anti-affinity rules are conflicting when running multiple consul server agents?

from consul-helm.

ervikrant06 avatar ervikrant06 commented on July 23, 2024

Yes, I also hit the same issue this is happening because of affinity rules only. for redundancy purpose they want to start the single consul server on each node.

from consul-helm.

mitchellh avatar mitchellh commented on July 23, 2024

This seems like two things:

  • We need docs to state you'll need at least N distinct nodes available where N is the number of Consul servers.
  • OR: you need to get rid of the affinity rules. We need to add configuration to allow this.

from consul-helm.

s3than avatar s3than commented on July 23, 2024

We resolved this issue by making the affinity a variable

    {{- if .Values.affinity }}
      affinity:
{{ tpl .Values.affinity . | indent 8 }}
{{- end }}

And then in the values

### Consul Settings
affinity: |
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchLabels:
            app: {{ template "consul.name" . }}
            release: "{{ .Release.Name }}"
            component: server
        topologyKey: kubernetes.io/hostname

This then means in minikube you can override with

## Affinity settings, this allows us to configure and run in Minikube
affinity: |
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - weight: 1
      podAffinityTerm:
        topologyKey: kubernetes.io/hostname
        labelSelector:
          matchExpressions:
          - key: component
            operator: In
            values:
            - "{{ .Release.Name }}-{{ .Values.Component }}"

from consul-helm.

adilyse avatar adilyse commented on July 23, 2024

Thanks to @s3than, server affinity is now configurable in the values file! Additional documentation will be added once this PR in the Consul repository is merged.

from consul-helm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.