Setting up the Consul Server

Prerequisites

Procedure

  1. Pull the Consul image.
    docker pull progrium/consul
    
    
  2. Tag and push this image to Google Container Registry using the following commands:
    docker tag progrium/consul gcr.io/<project name>/progrium/consul 
    gcloud docker tag gcr.io/<gcloud project name>/progrium/consul 
    				
    				
  3. Configure the yaml file as below
    apiVersion: v1
    kind: ReplicationController
    metadata:
      name: consul-server 
    labels:
        app: consul-service
    spec:
      replicas: 1
      selector:
        app: consul-server
      template:
        metadata:
          name: consul-server
          labels:
            app: consul-server
        spec:
          containers:
            - name: consul-server
              image: your image name 
              args:
                - '-server'
                - '-bootstrap'
              imagePullPolicy: Always
              ports:
                - containerPort: 8500
                - containerPort: 8400
                - containerPort: 53
                  protocol: UDP
     
    			 
  4. Execute the command:
    kubectl create -f <yaml file>
    
    
  5. Get the external IP address of the Consul service and from the browser launch Consul UI using
    http://External IP
    
    
  6. Configure the Key/Value pair for your application as following:
    <BWCE application name>/<Profile Name>/<Key Name>
    
    
    For example,
    tibco.bwce.sample.palette.jms.Consul.application/dev/MESSAGE
    
    
    or
    tibco.bwce.sample.palette.jms.Consul.application/qa/MESSAGE