Managing SC//Reliant Platform Manager data for containers

Managing SC//Reliant Platform Manager data for containers

This page describes the properties in SC//Reliant™ Platform Manager that define your containers, the registries their images are pulled from, and their networking, volumes, and resource limits. For the container configurations the platform supports (singleton, clustered, or a mix of the two), see Managing containers. For a conceptual overview of volumes, see Using data volumes.

Understanding data priority

When the SC//Reliant Platform Manager stores data, the data for the cluster (the Cluster Docker Resources hash) takes precedence over singleton data (the Docker hash) for the same property. For example, when you are defining a Docker container network configuration, if you specify two networks with the same name (one on singleton and another on cluster) then when they are merged the one on the cluster will take precedence and be configured after Puppet is run.

The following is the priority order:

  1. Cluster Docker Resources hash
  2. Docker hash
  3. Default property values

It's considered best practice to ensure that all containers have a unique name. When two containers have the same name, this causes unpredictable behavior on Docker DNS due to duplicate entries on Docker DNS redirecting to different containers. If you want to use similar names for different containers, the recommended approach is to use a suffix. For example, if you have two NGINX containers defined you may name them NGINX_fixed and NGINX_cluster.

Docker resources hash properties reference

The following are the high-level properties that are used when defining the resources for your containers. They are defined in the Docker and Cluster Docker Resources hashes in SC//Reliant Platform Manager. We dive deeper into each hash later in the document.

PropertyTypeDescriptionRequired
Proxy ServerTextThe proxy server address to use for pulling container images.No
Amazon Elastic Container Registry (ECR)HashThe configuration for the Amazon ECR private registry to pull container images from. This hash includes the URI of your Amazon ECR private registry as well as the AWS access key and AWS secret access key to authenticate to the registry to pull images.No
Microsoft Azure Container Registry (ACR)HashThe configuration for the ACR private registry to pull container images from. This hash includes the registry name, the service principal's application (client) ID, the service principal's password (client secret), and the Azure tenant ID.No
Google Artifact Registry (GCR)HashThe configuration for the GCR artifact registry to pull container images from.No
Other private registriesHashThe general configuration for other Docker compatible registries to pull container images from.No
Docker networksHashThe Docker container network configuration.Yes
VolumesHashThe configuration details for data volumes. For containers inside the cluster, after defining a data volume, you should reference the volume in the Containers hash as shared volumes to bind mount them in a container. For containers outside the cluster, you should reference the volume in the Containers hash as attached volumes to bind mount them in a container.No
ContainersHashThe Docker container configuration. A Shared Volumes hash is included to reference the shared volume to bind mount to the container. An Exclusive Volumes hash is included to configure a volume to bind mount to an individual container.Yes
Network Access ControlHashThe network access control details. This is used to restrict external access to the containers to specific external networks. Using this option allows Docker to update iptables on the host.No
Docker VersionTextThe Docker Engine version to install on the node.No
Default Bridge IP AddressTextThe default bridge network address.No
Image ManagementHashThe container image management configuration. This includes configuring a schedule for pruning unused images and downloading images for staging.No

Container image management

The following hashes provide the configuration for the container image registry you use as well as any image management settings you'd like to apply to the nodes in your environment.

Amazon Elastic Container Registry (ECR) hash reference

When you use an Amazon ECR private registry to store your container images, you must enable the Amazon Elastic Container Registry (ECR) option in the Docker resources hash of your node group. This hash contains the AWS account and ECR private registry details used to authenticate and pull your container images. For more information, see What is Amazon Elastic Container Registry?.

FieldTypeDescriptionRequired
Registry URITextThe URI of your Amazon ECR private registry. It should be in the aws_account_id.dkr.region.amazonaws.com format where aws_account_id is your AWS account ID and region is the AWS Region your repositories reside in.Yes
AWS Access Key IDTextThe AWS access key ID. This is used for authenticating to your private registry.Yes
AWS secret access keyTextThe AWS secret access key. This is used for authentication to your private registry.Yes

Microsoft Azure Container Registry (ACR) hash reference

When you use Microsoft Azure Container Registry to store your container images, you must enable the Microsoft Azure Container Registry (ACR) option in the Docker resources hash of your node group. This hash contains the ACR account and registry details used to authenticate and pull your container images. For more information, see Azure Container Registry authentication with service principals.

FieldTypeDescriptionRequired
Registry nameTextThe name of your Azure Container Registry.Yes
APP IDTextThe service principal's application (client) ID.Yes
PasswordTextThe service principal's password (client secret).Yes
TenantTextThe Microsoft Azure tenant ID.Yes

Google Artifact Registry (GCR) hash reference

When you use Google Artifact Registry to store your container images, you must enable the Google Artifact Registry (GCR) option in the Docker resources hash of your node group. This hash contains the GCR account and registry details to authenticate when pulling your container images. For more information, see Configure Docker authentication to Artifact Registry.

FieldTypeDescriptionRequired
endpointTextThe endpoint of your Google Artifact Registry. It should be in the https://LOCATION-docker.pkg.dev format, where LOCATION is the regional or multi-regional location of the repository where the container image is stored.Yes
Client IDTextThe Google Cloud service account client ID. This corresponds to the client_id value in your key file.Yes
Client EmailTextThe Google Cloud service account client email address. This corresponds to the client_email value in your key file.Yes
Private Key IDTextThe Google Cloud service account key ID. This corresponds to the private_key_id value in your key file.Yes
Private KeyTextThe Google Cloud service account private key. This corresponds to the private_key value in your key file.Yes

Other private registries hash reference

When using another Docker-compliant private registry other than Docker Hub, Amazon ECR, Microsoft Azure Container Registry, or Google Artifact Registry, you must enable the Other private registries option in the Docker resource hash to provide the registry details.

If you use a public registry that doesn't require authentication, no additional details are needed in SC//Reliant Platform Manager for that public registry. You can simply reference the repository details when defining your container.

PropertyTypeDescriptionRequired
Registry URLTextThe URL or URI of the Docker compatible registry.Yes
UsernameTextThe username to use when authenticating to the registry.Yes
PasswordTextThe password to use when authenticating to the registry.Yes
Email AddressTextThe email address associated with the registry.No
VersionTextThe version number of the registry.No

Image management hash reference

You can configure SC//Reliant Platform Manager to perform management tasks on the container images on your nodes. These tasks include configuring a schedule for pruning unused images and downloading images for staging. On each host that is running containers, you can view the /opt/reliant/managed_images file for a list of Docker images managed by the SC//Reliant platform.

PropertyTypeDescriptionRequired
Prune ImagesHashAllows you to define a cronjob that prunes unused Docker images on a schedule.No
Stage ImagesHashAllows you to define a cronjob that pulls a list of container images on a schedule. This is useful for pre-staging Docker container images. Any images defined here are placed into a managed file which is excluded from pruning.No

Docker networking

Docker networks hash reference

The Docker networks hash is used to define the networking configuration the containers you create can use. Once a network is defined, you can connect a container to the network in the Containers hash.

Docker doesn't support updating the configuration of a network after it's been created on a host. If you need to change a network configuration, you must disconnect all containers from the network, remove the network, and then recreate the network using SC//Reliant Platform Manager and Puppet.

PropertyTypeDescriptionRequiredDefault value
Network nameTextThe name of the network to be created.Yes-
DriverTextThe Docker network driver to use. The most common drivers to use are bridge, host, or none. For more information, see Docker network drivers.Yesbridge
Network Driver OptionsTextThe list of network driver options to use. The available options are dependent on the network driver used. For more information, see Docker network drivers. When a driver option is specified, it must be in the format <option>=<value>.No-
SubnetMultiThe IP address subnet to assign to the network. It can be specified as either a CIDR or you can specify DHCP.No-
GatewayTextThe IP address of the gateway for the Docker network subnet.No-
IP address range for DHCPTextWhen DHCP is specified for the subnet, this is the IP address range for the Docker network.No-

Network Access hash reference

PropertyTypeDescriptionRequiredDefault value
Network access nameTextThe network access rule nameYes-
Source NetworkText, IP Address, or DHCPSource network address that will be allowed to access Docker containers. The address can be either a network IP address (with /mask), or a plain IP address. Ex: 192.168.0.0/24Yes-
ProtocolTextThe protocol of the rule or of the packet to check. The specified protocol can be one of tcp, udp, icmp, or the special keyword all.Noall
Destination Docker Network NameTextThe name of the Docker network to which the container is connected. External access is limited to containers on this network. The network name can be a name of a network created on the Networks sub-hash or empty. If no network name is given, all Docker containers will be accessible from this source network.No-

Data volumes

The following hashes are used to manage the data volumes associated with your containers.

Volumes hash reference

The Volumes hash is where you define all of the data volumes your containers need to use. These data volumes are then referenced in the Containers hash for each container that needs to use them. The data volumes are created on the node and then bind mounted in the configured container. For a deeper dive on how data volumes are used, see Using data volumes.

PropertyTypeDescriptionRequiredDefault value
Host PathTextThe absolute path on the host to bind mount the shared volume to.No/docker/<shared_mount_name> is the default if no value is specified or if DRBD is configured.
DRBDHashThe configuration for DRBD. This is an open source distributed block storage solution that is used to replicate volumes across clustered nodes.No-
PortNumberThe TCP network port that DRBD uses to facilitate replication and synchronization between the nodes in the cluster.Yes, if DRBD is configured.-
Device NameTextThe virtual block device name that DRBD creates and manages on each node in the cluster. The Device Name value must be unique. We recommend using sequential values like drbd90, drbd91, etc. Keep in mind that if you are also hosting KVM virtual machines that are configured for DRBD replication that the device names must also be unique across both technologies.Yes, if DRBD is configured.-
Volume GroupTextThe Logical Volume Management (LVM) volume group that DRBD utilizes as the underlying storage for replication.Yes, if DRBD is configured.-
Disk SizeTextThe size of the DRBD managed block device. You should ensure that the hard drive on each host node has enough space for the sum of all of the DRBD virtual block devices you define in SC//Reliant Platform Manager. It's recommended that you specify the unit postfix.Yes, if DRBD is configured.-
UserTextThe user that is set as the owner of the mapped directory for the shared volume.NoIf no value is set, a user named shared-mount is used.
GroupTextThe group that is set as the owner of the mapped directory for the shared volume.NoIf no value is set, a group named shared-mount is used.

Shared Volumes hash reference

The Shared Volumes hash is defined inside the Containers hash inside of the Cluster Docker Resources hash. This is used when you have a data volume that is intended to be shared by multiple containers.

PropertyTypeDescriptionRequiredDefault value
Container PathTextThe absolute path inside the container to bind the mount to.Yes-

Exclusive Volumes hash reference

The Exclusive Volumes hash is defined inside the Containers hash inside of the Cluster Docker Resources hash. This is used when you have a data volume that is intended for use only by a single container.

PropertyTypeDescriptionRequiredDefault value
Container PathTextThe absolute path inside the container to bind the mount to.Yes-
Host PathTextThe absolute path on the host to bind to the container.No/docker/container_name-mount_name is the default if no value is specified or if DRBD is configured.
DRBDHashThe configuration for DRBD. This is an open source distributed block storage solution that SC//Reliant uses.No-
PortNumberThe port to use for the drbd service on the cluster.Yes, if DRBD is configured.-
DeviceTextThe DRBD device name.Yes, if DRBD is configured.-
Volume GroupTextThe LVM volume group to use to make the DRBD logical volume.Yes, if DRBD is configured.-
Disk SizeTextThe size of the DRBD disk. It's recommended that you specify the unit postfix.Yes, if DRBD is configured.-

Container resource definitions

Resource Limitations hash reference

The Resource Limitations hash is where you define the host node resources (CPU and memory) to make available to the containers running on the host node.

PropertyTypeDescriptionRequiredDefault value
MemoryTextThe maximum amount of memory to allocate to the container.Yes-
Swap MemoryTextThe amount of memory the container is able to swap to disk.Yes-
CPU ResourcesTextThe maximum amount of CPUs to allocate to the containerYes-
CPU SharesNumberSet this property to a value greater or less than the default of 1024 to increase or reduce the container’s weight, and give it access to a greater or lesser proportion of the host machine’s CPU cycles. This is only enforced when CPU cycles are constrained. When plenty of CPU cycles are available, all containers use as much CPU as they need.Yes1024

Container definitions

Containers hash reference

The Containers hash is where you define the Docker containers to run in your environment.

When specifying environment variables, if the environment variable value includes special characters or spaces then we recommend using the Environment File Content parameter as opposed to the Environment Variables parameter. This is due to a limitation of the Docker Resource agent which can't properly interpret arguments that have spaces in them.

PropertyTypeDescriptionRequiredDefault value
Container nameTextThe name of the container.Yes-
ImageTextThe container image name. If no registry details are provided, an image on Docker Hub is assumed. If you are using another registry, you should specify the full registry URI including the repository name.Yes-
TagTextThe tag to use for the container image.No-
Force Image UpdateBooleanWhether or not to force the image to be updated for the container. This option assumes the tag already exists but has a different digest than the existing container image.NoDisabled
UserTextThe user (UID) to run the container as. For example, admin.No-
GroupTextThe group (GID) to run the container as.No-
Exposed PortsTextThe ports to expose outside of the defined Docker network.No-
NetworksTextThe name of the Docker network the container uses. This is defined in the Custom Networks hash.Yes-
Shared VolumesHashThe shared volume(s) to mount inside the container. The shared volume must first be defined in the Shared Volume(s) hash prior to being available to specify here.No-
PathTextThe file path to mount the shared volume to inside the container. This is only specified when the Shared Volumes hash inside the Containers hash is enabled.No-
Exclusive VolumesHashThe details of the volumes to mount inside the container. These are separate from the shared volumes.No-
Depends OnTextThe dependencies defined for container startup. If you provide a container name, that container must start up before this container is able to.No-
Environment File ContentTextThe environment variables to pass to the container. These must be specified one environment variable per line. They are then converted into an environment variable file that is passed to the container. This value maps to the --env-file option on the docker run command.No-
Environment VariablesTextThe environment variables to pass to the container. These are specified as individual variables. This value maps to Env in the docker create-container command and the --env option on the docker run command.No-
Resource LimitationsHashThe CPU and memory resource allocations to reserve for the container.No-
Optional Runtime ParametersListA list of Docker runtime parameters. These are specified as key-value pairs and give you additional control over the capabilities available to the container. For more information, see Runtime privilege and Linux capabilities in the Docker documentation.

Environment File Content and Environment Variables

There are two ways to inject environment variables into a container at runtime. You can specify individual environment variables by using the Environment Variables property or you can specify multiple environment variables by having the SC//Reliant platform create an environment variable file by specifying a line delimited list of environment files using the Environment File Content property.

One of the unique features within the SC//Reliant Platform Manager is the ability to specify a property reference in an environment variable. For example, if you had a property named Docker Release Tag and you wanted to reference that property value as an environment variable, you could use the following syntax when specifying the environment variable. This feature only works with the Environment Variables property.

TEST_ENV=%{lookup('my_docker_release_tag')}

For an example of using a property reference to set a container's image tag on each node, see Use case: Specifying container image tags as a property reference.