Configuring Dockerized IBM Spectrum Symphony service instances

Configure and start an IBM® Spectrum Symphony service instance inside of a Docker container.

Before you begin

  • The enableDockerForServiceInstance parameter must be set to true in the application profile.
  • Docker 1.9.1 must be installed on the compute host.
  • Python must be installed on the compute host.
  • You must provide the required Docker image for the compute host, containing all the dependency libraries for the service instance.
  • The cluster administrator must have permission for the Docker socket and Docker binary in the host OS.

About this task

You can start a service instance inside of a new Docker container and submit workload to that service instance.

Procedure

  1. Follow the procedure in Deploying an IBM Spectrum Symphony cluster with Kubernetes and Docker containers to create the IBM Spectrum Symphony primary host with the Kubernetes YAML file.
  2. Before creating the IBM Spectrum Symphony compute host with the Kubernetes YAML file, mount the Docker data from the host OS as follows:
    kind: ReplicationController
    apiVersion: v1
    metadata:  
      name: sym-compute-rc
    spec:  
      replicas: 3
      selector:
        component: sym-compute
      template:
        metadata:
          labels:
            component: sym-compute
        spec:
          containers:
            - name: sym-compute
            image: sym712:v1
            commmand: ["/bin/sh", "-c", "source /opt/ibm/platform/profile.platform; sudo chmod 777 /etc/hosts; 
                      echo '10.32.0.1 sym-primary-04yws' >> /etc/hosts; egoconfig join sym-primary-04yws -f; 
                      egosh ego start; sudo /usr/sbin/sshd -D"]
            resources:           
              requests:
                memory: 2048M
              limits:
                memory: 2048M
            volumeMounts:
              - name: dockersocket
                mountPath: /var/run/docker.sock
                readOnly: false
              - name: dockerbinary
                mountPath: /usr/bin/docker
                readOnly: false
              - name: dockerconf
                mountPath: /etc/sysconfig/docker
                readOnly: false
              - name: dockercurrent
                mountPath: /usr/bin/docker-current
                readOnly: false
            securityContext:
                privileged: true
          volumes:
           - name: dockersocket
             hostPath:
               path: /var/run/docker.sock
           - name: dockerbinary
             hostPath:
               path: /usr/bin/docker
           - name: dockerconf
             hostPath:
               path: /etc/sysconfig/docker
           - name: dockercurrent
             hostPath:
               path: /usr/bin/docker-current
          nodeSelector:
             component: sym-compute
  3. Create the IBM Spectrum Symphony compute hosts with the Kubernetes YAML file.
    1. Get the primary host name and IP address:

      kubectl get pods

      NAME                   READY     STATUS   RESTARTS    AGE
      sym-primary-rc-04yws    1/1       Running  0           46m

      kubectl describe pod sym-primary-rc-04yws|grep IP

      IP:                10.32.0.1
    2. Manually add the IBM Spectrum Symphony primary host name and IP address to the command in the compute host YAML file as shown in step 2. The following is a sample of the YAML file where the primary host name and IP address are added to the command:
      "command: ["/bin/sh", "-c", "source /opt/ibm/platform/profile.platform; 
                sudo chmod 777 /etc/hosts; echo '10.32.0.1 sym-primary-rc-04yws' >> 
                /etc/hosts; egoconfig join sym-primary-rc-04yws -f; 
                egosh ego start; sudo /usr/sbin/sshd -D"]"
    3. Create the IBM Spectrum Symphony compute hosts with the YAML file:

      kubectl create -f sym-compute-rc.yaml

      replicationcontroller "sym-compute-rc" created
  4. Submit workload to the service instance.

Results

The service instance is running inside the Docker container on the host OS.