Minishift and the Enterprise: Registration

Posted: April 28th, 2018 | Author: | Filed under: Technology | Tags: , | No Comments »

One of the many hallmarks of Open Source Software is the ability for anyone in the community to freely contribute to a software project. This open model provides an opportunity to garner insight into the direction of a project from a larger pool of resources in contrast to a closed sourced model where software may be regulated by a single organization or group. Many enterprises also see the value of Open Source Software to power their most critical systems. However, enterprises must be cognizant that Open Source Software from the community may not have the integrity that they have been accustomed to when using software obtained directly from a vendor. Red Hat, as a leader of Open Source Software solutions, provides a subscription model that can be used to meet the quality and support requirements necessary by any organization. A subscription includes fully tested and hardened software, patches, and customer support. Once a subscription has been purchased, licensed software must be registered to activate the necessary included features.

The Container Development Kit (CDK) is the supported version of the upstream minishift project, and given that the software package is built on top of a Red Hat Enterprise Linux base, a valid subscription associated with a Red Hat account is required to access the entire featureset provided by the CDK. To enable the development on Red Hat’s ecosystem of tools, a no-cost developer subscription is available through the Red Hat Developer program and includes an entitlement to Red Hat Enterprise Linux along with a suite of development tools that are regularly updated with the latest enhancements and features. Information about the Red Hat Developer Subscription along with the steps to create an account can be found at the Red Hat Developer Website.

Once a Red Hat Developer account has been obtained, the configuration of associating the account within the CDK can be completed. These steps were detailed in the prior post, Minishift and the Enterprise: Installation.

While the Red Hat Developer subscription is a great way for developers to take advantage of enterprise Linux software, many organizations frown upon the use of personal licenses operating within the organization, especially on company owned machines. The CDK is configured to automatically register and associate subscriptions against Red Hat’s hosted subscription management infrastructure. Accounts for developers can be created within the Red Hat Customer Portal for use with the CDK. As described in the post Minishift and the Enterprise: Proxies, subscription-manager, the tool within RHEL for tracking and managing subscriptions, is automatically configured to traverse a corporate proxy server to the public internet when this option is enabled. This feature, as previously mentioned, is useful as most enterprises employ some form of barrier between the end user and external network.

Unfortunately, many enterprises do not use Red Hat’s hosted subscription management system to register machines on their network and instead leverage Red Hat Satellite within their internal network. The CDK, as of version 3.4, is only able to register subscriptions against Red Hat automatically as part of normal startup. Fortunately, there are methods in which the user can configure the CDK to register against a satellite server instead of Red Hat. These options include:

  1. Executing commands to facilitate the registration process
  2. Leveraging an add-on which streamlines the registration process

Regardless of the method utilized, the CDK should be instructed to not attempt to register the machine during startup. This is accomplished by passing the –skip-registration parameter when executing the minishift start command as shown below:

minishift start --skip-registration

Even though the RHEL machine within the CDK is not registered, the majority of the functionality will remain unaffected. The key exception is managing software packages using the yum utility. Since RHEL based images inherit subscription and repository information from the host they are running on, operations both on the host machine as well as within a container making use of yum will fail due to the lack of valid subscriptions. This is primarily noticeable at image build time as it typically involves the installation of packages using yum.

The RHEL machine within the CDK can be registered manually in a similar fashion to any other RHEL machine using the subscription-manager utility. To gain access to a prompt within the CDK, the minishift ssh command can be used.

minishift ssh

By default, an ssh session is established within the CDK using the “docker” user. Since subscription-manager requires root privileges, access must be elevated using the sudo command. Execute the following command to elevate to the root user:

sudo su -

With access to root privileges, the machine can now be registered to Red Hat using the subscription-manager register command. Either a username/password or activation key/organization combination can be used as follows:

subscription-manager register --username=<username> --password=<password>


subscription-manager register --org=<organization> --activationkey=<activation_key>

In either case, adding the –auto-attach parameter to each command will attach a subscription automatically to the new registration.

To subscribe the CDK against an instance of Red Hat Satellite instead of Red Hat’s hosted infrastructure, many of the same commands can be reused. An additional step is required to first download the bundle containing the certificates for the Satellite server so that the CDK can communicate securely to facilitate the registration process. Execute the following command to install the certificates into the CDK:

rpm -Uvh http://<satellite_server>/pub/katello-ca-consumer-latest.noarch.rpm

Now use subscription-manager to complete the registration process using the –org and –activationkey parameters:

subscription-manager register --org=<organization> --activationkey=<activation_key> --auto-attach

To validate the CDK is properly subscribed, let’s start a new container and attempt to install a package using yum by executing the following command within the CDK:

docker run -it --rm rhel:7.4 yum install -y dos2unix

If the above command succeeded, the CDK is properly registered and subscribed.

Installing the Ansible Playbook Bundle CLI Using Homebrew

Posted: April 15th, 2018 | Author: | Filed under: Technology | 1 Comment »

An Ansible Playbook Bundle is a lightweight application definition that utilizes a short-lived container to choreograph the deployment of applications. By leveraging the power of the Ansible configuration management tool within the Open Service Broker API specification, it has never been easier to orchestrate even the most complex application. For developers looking to make use of this framework, a command line tool called apb is available to facilitate the creation, building and publishing of Ansible Playbook Bundles. The tool can be installed from an rpm package, built from source, or even run within a container itself.

A challenge presents itself for developers who are striving to jump right into APB development, but may be on an Operating System that either does not support rpm packages, or do not want to install an extra set of tools to build the application from source. For those running OSX, Homebrew has become the defacto package manager akin to yum for certain Linux distributions. Installing software packages which, previously proved to be a challenge, can be accomplished with a simple command, like brew install node. Now, developers can take advantage of the ease of use and wide adoption of Homebrew to install the apb CLI!

First, ensure Homebrew is installed on the local machine. Full instructions can be found at the Homebrew website.

Within Homebrew, software packages are organized into Formulas. The majority of the packages that most users leverage are in the core set of formulas. However, formulas can exist outside of the core and be referenced from external sources, known as Taps. apb resides as a formula that is brought into Homebrew on a machine using a tap.


Add the tap containing the apb formula:

brew tap sabre1041/openshift

With the tap installed, install the apb CLI:

brew install apb

After the process completes, the tool will be installed.

To verify the installation, execute the following command:

apb version

If a response was returned, the installation of the apb CLI was successful.

With only a few short commands, developers of Ansible Playbook Bundles within the OSX ecosystem can quickly begin to create powerful applications.