Add node selectors

If you created multiple node pools in your cluster as recommended in the cluster setup prerequisites, then you must map those node pools to individual Apigee Hybrid components in the overrides.yaml file. For the simplest recommended configuration, you map a stateful node to Cassandra and a stateless node to the other runtime components.

How you do the mapping depends on whether you are using a GKE cluster or a non-GKE cluster, as explained below. For additional information, see Configure dedicated node pools.

Follow these steps to add stateful node selector to Cassandra. In this example, the stateful node is called apigee-data:

  1. Open the overrides.yaml file for edit if it is not already open.
  2. Add the nodeSelector for the stateful node to Cassandra. In this example, the stateful node is called apigee-data:
    ...
    cassandra:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-data
      storage:
        type: gcepd
        capacity: 50Gi
        gcepd:
          replicationType: regional-pd
    ...
    
  3. Add the nodeSelector for the stateless node to the rest of the runtime components. In this example, the stateless node is called apigee-runtime:
    ...
    mart:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
      sslCertPath: path-to-file/mart-server.crt
      sslKeyPath: path-to-file/mart-server.key
      hostAlias: my_dns
    
    runtime:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
    
    synchronizer:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
    
    udca:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
    
    istio:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
    
    authz:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
      ...
    
    logger:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
      serviceAccountPath: "path-to-file"
    
    metrics:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
    
  4. Save the overrides.yaml file.
  5. Go to the next step, Enable logging.

Add node selectors for a non-GKE cluster

For CNCF-conformant versions of Kubernetes (but not GKE or OpenShift), you must explicitly assign each worker node to the node pool, in addition to configuring the Message Process and Cassandra services in overrides.yaml.

To add node selectors for a non-GKE cluster:

  1. Get a list of node names for your cluster:
    kubectl get nodes
  2. Assign cassandra worker nodes to the stateful node pool by using kubectl, as the following example shows:
    kubectl label node cassandra_node_name node-pool=stateful_nodepool_name

    For example:

    kubectl label node ip-10-50-99-225.ec2.internal node-pool=apigee-data

    Repeat this step for each Cassandra worker node in the cluster.

  3. Assign the other nodes to the stateless node pool by using kubectl, as the following example shows:
    kubectl label node node_name node-pool=stateless_nodepool_name

    For example:

    kubectl label node ip-10-50-56-83.ec2.internal node-pool=apigee-runtime
  4. Add the nodeSelector for the stateful node to Cassandra. In this example, the stateful node is called apigee-data:
    ...
    
    cassandra:
      nodeSelector:
        key: node-pool
        value: apigee-data
      storage:
        type: gcepd
        capacity: 50Gi
        gcepd:
          replicationType: regional-pd
      sslRootCAPath: path-to-file/cassandra-cert.pem
      sslCertPath: path-to-file/cassandra-keystore.pem
      sslKeyPath: path-to-file/cassandra-keystore.key
      auth:
        default:
          password: "abc123"
        admin:
          password: "abc234"
        ddl:
          password: "abc345"
        dml:
          password: "abc456"
    ...
    
  5. Add the nodeSelector for the stateless node to the rest of the runtime components:
    ...
    mart:
      nodeSelector:
        key: node-pool
        value: apigee-runtime
      sslCertPath: path-to-file/mart-server.crt
      sslKeyPath: path-to-file/mart-server.key
      hostAlias: my_dns
    
    runtime:
      nodeSelector:
        key: node-pool
        value: apigee-runtime
    
    synchronizer:
      nodeSelector:
        key: node-pool
        value: apigee-runtime
      ...
    
    udca:
      nodeSelector:
        key: node-pool
        value: apigee-runtime
    
    istio:
      nodeSelector:
        key: node-pool
        value: apigee-runtime
    
    authz:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
      ...
    
    logger:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
      serviceAccountPath: "path-to-file"
    
    metrics:
      nodeSelector:
        key: cloud.google.com/gke-nodepool
        value: apigee-runtime
    
  6. Save the overrides.yaml file.
  7. Go to the next step, Enable logging.

Next Step

1 2 3 4 5 6 NEXT: 7: LOGGING 8 9 10 11