This post was originally published by Sebastian Faulhaber on OpenSourcers.com.

Install Ansible Service Broker Addon into Your CDK Installation

Start your Red Hat Container Development Kit (CDK) environment with registration (this is important, as yum gets used during Addon installation).

export MINISHIFT_ENABLE_EXPERIMENTAL=y
minishift start --service-catalog

Clone the addon repository and install Ansible Service Broker Addon:

git clone https://github.com/minishift/minishift-addons.git
cd minishift-addons/add-ons/
minishift addon install ansible-service-broker
minishift addon apply ansible-service-broker

When logging in to your CDK console, you should already see the preinstalled Ansible APBs:
Preinstalled APBs

Install the ABP Command Line on Your Client Machine

Configure your shell to use the Minishift Docker daemon:

eval $(minishift docker-env)

Fetch the APB command line script and make it available in your PATH:

wget https://raw.githubusercontent.com/ansibleplaybookbundle/ansible-playbook-bundle/master/scripts/apb-docker-run.sh && mv apb-docker-run.sh apb && chmod +x apb

Verify that your installation works:

apb --help

If everything went well, you should see something like this:
very installation

Test the Connection Between ABP CLI and CDK

You will need special permissions to work with the broker on your CDK installation. Therefore, we need to execute the following:

oc adm policy add-cluster-role-to-user cluster-admin developer
oc login -u developer

Now let’s see if we can list the preinstalled APBs:

apb list

APB list

Configure Ansible Service Broker to Pull Images from Local Registry

In the default config of our Ansible Service Broker, the APBs are pulled from https://registry.hub.docker.com/. We need to change this to our local registry running within CDK.
Change local registry

registry:
- type: local_openshift
name: lo
namespaces:
- openshift
white_list:
- ".*-apb$"

The Ansible Service Broker pod now needs to be restarted in order to pull in the new configuration.

Create your first APB

First, we use the CLI to scaffold our new service:

apb init sample-service-apb
cd sample-service-apb

Now we locally build our APB. After the process has completed, the newly built APB docker image should appear in your local Docker registry:

apb build

APB build

Finally, we need to push the Docker image to our Service Broker inside CDK:

apb push

Now you should be able to see your first APB in your CDK’s service catalog:

APB in CDK service catalog

References

Learn more about Ansible Playbook development and the Minishift Addon from these resources:


关于作者

UI_Icon-Red_Hat-Close-A-Black-RGB

按频道浏览

automation icon

自动化

有关技术、团队和环境 IT 自动化的最新信息

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

open hybrid cloud icon

开放混合云

了解我们如何利用混合云构建更灵活的未来

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Virtualization icon

虚拟化

适用于您的本地或跨云工作负载的企业虚拟化的未来