timescale / helm-charts

Configuration and Documentation to run TimescaleDB in your Kubernetes cluster
Apache License 2.0
263 stars 223 forks source link

How can I make sure replicas are scheduled on replica nodes and primary on the primary node #580

Closed cryptobench closed 1 year ago

cryptobench commented 1 year ago

Hello everyone! I am pretty new to kubernetes and exploring helm charts for TimeScaleDB. I Have a cluster setup with nodes that have the label: workertype:dbprimary and workertype:dbreplica

I am looking to edit the values.yaml file to assign replica pods to workertype:dbreplica and the primary pod to workertype:dbprimary

I have tried setting nodeSelector under service.primary.spec.nodeSelector but that's invalid and returns

Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Service.spec): unknown field "nodeSelector" in io.k8s.api.core.v1.ServiceSpec
cryptobench commented 1 year ago

I made the following changes to the chart , but it doesn't get scheduled on the correct node.

service:
    primary:
        # One of (ClusterIP | LoadBalancer | NodePort). Headless services are not supported.
        type: ClusterIP
        # The port used by the service.
        port: 5432
        # Optional NodePort, only used for type `NodePort`.
        nodePort: null
        # Additional labels to be added to the Service.
        labels: { "dbtype": "primary" }
        # Additional annotations to be added to the Service.
        annotations: {}
        # Define extra fields to be interpolated into the Service spec.
        #
        # This allows for adding support for new features and functionality which may not yet
        # be directly supported in this chart.
        spec: {}
        nodeSelector:
            workertype: "dbprimary"

        # loadBalancerSourceRanges:
        # - "0.0.0.0/0"

    replica:
        # One of (ClusterIP | LoadBalancer | NodePort). Headless services are not supported.
        type: ClusterIP
        # The port used by the service.
        port: 5432
        # Optional NodePort, only used for type `NodePort`.
        nodePort: null
        # Additional labels to be added to the Service.
        labels: { "dbtype": "replica" }
        # Additional annotations to be added to the Service.
        annotations: {}
        # Define extra fields to be interpolated into the Service spec.
        #
        # This allows for adding support for new features and functionality which may not yet
        # be directly supported in this chart.
        spec: {}
        # loadBalancerSourceRanges:
        # - "0.0.0.0/0"
        nodeSelector:
            workertype: "dbreplica"
github-actions[bot] commented 1 year ago

This issue went stale because it was not updated in a month. Please consider updating it to improve the quality of the project.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 30 days with no activity.