Dockerizing IBM Spectrum Symphony service instances with Kubernetes
Dockerize an IBM® Spectrum Symphony service instance to run the service instance inside of a Docker container on Docker enabled hosts.
Dockerizing service instances overview
$ docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock -v
/usr/bin/docker:/usr/bin/docker -v /etc/sysconfig/docker:/etc/sysconfig/docker -v
/usr/bin/docker-current:/usr/bin/docker-current rhel docker ps
For Dockerized service instances in a Kubernetes environment, the service instance's Docker container is started by the Docker daemon on the host OS with the Docker 'host' network mode. If the host name is retrieved, the host name of host OS is returned. With symping, the symping service will return the host name of the Docker host in the service code to the symping client.
The service instance manager starts the Docker controller with the start command. By default, IBM Spectrum Symphony uses the consumer OS execution user as the Docker container user.
Docker configuration
You can control the Docker configuration within the Docker section of the application profile, or from the client API.
- Default mounted data volumes from deployment directories like $EGO_TOP and $SOAM_DEPLOY_DIR.
- Container definition mounted data volumes in the application profile, from beginning to end.
- Mounted data volumes from the client API, in the order of the API calls that are made.
<Consumer applicationName="myapp" resourceGroupName="DockerRG"
enableDockerForServiceInstance="true" dockerVersions="1.7.0"
enableSlotRatioResourceLimitScaling="true".../>
<Docker>
<ContainerDefinition
name="containerDef1" imageName="RHEL7_IMG"
registryUrl="192.168.7.26:5000" containerUser="root" >
<mount hostDir="/data1" containerDir="/data1" permission="ro" />
<mount hostDir="/opt/data2"
containerDir="/data2" permission="rw" />
......
</ContainerDefinition>
</Docker>
<Service name="myservice" packageName="mypackage" dockerContainerDefinitionName="containerDef1">
<osTypes>
<osType startCmd="java -classpath ${SOAM_DEPLOY_DIR}/MyService.jar MyService">
<resourceUsage>
<memory physicalMemoryLimit="1024" virtualMemoryLimit="1024"/>
<cpu cpuLimit="10"/>
</resourceUsage>
</osType>
</osTypes>
…
</Service>
To
configure the application profile to run service instance inside of a Docker container, see
Configuring Docker for IBM Spectrum Symphony service instances.