Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How-to: Install Helm package manager for on-premise Oracle Linux and Kubernetes

Jaap Romers-OracleJun 11 2019 — edited Jun 11 2019

In this how-to guide I describe the configuration steps to install Helm from the Oracle Linux distribution. For generic information on Helm go to the Helm Documentation website.

Helm is a package-manager for Kubernetes, like yum is package-manager for Oracle Linux. Helm charts are packages of pre-configured Kubernetes resources and it makes deploying applications in Kubernetes very easy. Helm has additional features such as versioning, delete, upgrade or rollback deployments.

The Helm client is a program that you run as a developer or ops person. But there is also a second part to Helm and that is Tiller, this is the server side component of Helm and it runs in the Kubernetes cluster and handles the Helm packages.

Install Helm package

The version of Helm that is used at the moment of writing is available in the ol7_developer channel of Oracle Linux. First step is to install the Helm program in Oracle Linux:

# sudo yum-config-manager --enable ol7_developer 
# sudo yum install helm

Create Kubernetes secret and service-account

We use the Oracle Linux version of Helm/Tiller and the Tiller component is hosted as container image on the Oracle Container Registry. Before installing Tiller make sure you have accepted Oracle Standard Terms and Restrictions in Container Services (Developer) section on the Oracle Container Registry.

A worker node in the Kubernetes cluster needs to authenticate against the registry with your Oracle SSO credentials to pull the Tiller image from the registry. You can do this by storing your Oracle SSO credentials in a Kubernetes secret object and use that secret when you deploy the container image:

# kubectl create secret docker-registry ora-registry --namespace kube-system \
  --docker-server=container-registry.oracle.com \
  --docker-username="joe.random@oracle.com" \
  --docker-password="joe_sso_passwd" \
  --docker-email="joe.random@oracle.com"

A Kubernetes service-account provides an identity to running processes in the cluster. A tiller service account is created and we add the ora-registry Kubernetes secret from the previous step to it:

# kubectl create -f - <<EOF 
apiVersion: v1
kind: ServiceAccount
metadata:
  name: tiller
  namespace: kube-system
imagePullSecrets:
  - name: ora-registry
EOF

Tiller needs to manage resources in all namespaces of the cluster, so we need to create a kind of super-user access for the tiller service-account. This is done by creating a ClusterRoleBinding:

# kubectl create clusterrolebinding tiller-cluster-rule \ 
  --clusterrole=cluster-admin \
  --serviceaccount=kube-system:tiller

Initialize Helm and install Tiller

Now it's time to initialize Helm in the local CLI and deploy the Tiller container image into the Kubernetes cluster. This could be done in a single step:

# helm init --service-account tiller \ 
  --tiller-image \
  container-registry.oracle.com/kubernetes_developer/tiller:v2.9.1

To test if the installation works, you can do this quick test:

# helm version 
# helm repo update
# helm search mysql

Automated install script

The instructions in this How-to guide were provided by AmedeeBulle and he was so kind to provide the helm-oracle.sh shell-script to automate the installation steps. Running this script (replace Oracle SSO username in the script with yours before running the script) is even more secure than providing CLI commands beacuse it hides your password from the command-line history.

Comments

odie_63
Answer
Are you working with something like this?
<?xml version="1.0" encoding="WINDOWS-1252" ?>
<report name="MODULE1" DTDVersion="9.0.2.0.10">
  <xmlSettings xmlTag="MODULE1" xmlPrologType="text">
  <![CDATA[<?xml version="1.0" encoding="&Encoding"?>]]>
  </xmlSettings>
  <data>
    <systemParameter name="MODE" initialValue="Default"/>
    <systemParameter name="ORIENTATION" initialValue="Default"/>
  </data>
  <layout>
  <section name="main">
    <body>
      <image name="B_1">
        <geometryInfo x="0.00000" y="0.00000" width="8.31250" height="6.25000"
        />
        <visualSettings fillPattern="transparent" fillBackgroundColor="black"
         linePattern="transparent" lineBackgroundColor="black"/>
        <points>
          <point x="0.00000" y="0.00000"/>
          <point x="8.31250" y="6.25000"/>
          <point x="0.00000" y="0.00000"/>
          <point x="8.31250" y="6.25000"/>
        </points>
        <binaryData encoding="hexidecimal" dataId="image.B_1">
          
FF8DFF0E 0001A464 94640010 10100006 00060000 FFBD0048 0001B0C0 E0C0A001
E0D0E021 11013181 82A18161 61811332 52D182A3 33D3C393 33837304 84C5E404
44755473 8305D615 75F52676 8676E3D4 17970746 87C55676 36101121 21815181
F2A1A1F2 36248324 36363636 36363636 36363636 36363636 36363636 36363636
36363636 36363636 36363636 36363636 36363636 36363636 3636FF4C 102A0000

[...]

D29681A8 4EB94557 F3D8D588 912F1FCE A2478278 4E157FE8 D3B2F257 A1906D14
A809D102 9F646EFF 007CA66A B08C98EF 2E5344BB 4978EEAD 55093F75 6A4E8D29
345ECCA0 4F537A2C 9CB424CB 8DDE0D7D 53D4D002 D3E32E6D 1942F70F 5D29740C
7CF15A56 1A469E72 F449A09D 918DE7CF 5F9F877A 17106FEF 474C484E 6F41C067
0D1338AF 1D06311A 4E6608F0 F4C40540 859FBFE7 579924E1 495C31FF 9D
        </binaryData>
      </image>
    </body>
  </section>
  </layout>
  <webSource>
  <![CDATA[<%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %> 
<%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp" session="false" %>
<%@ page contentType="text/html;charset=ISO-8859-1" %>
<!--
<rw:report id="report"> 
<rw:objects id="objects">
</rw:objects>
-->

<html>

<head>
<meta name="GENERATOR" content="Oracle 9i Reports Developer"/>
<title> Your Title </title>

<rw:style id="yourStyle">
   <!-- Report Wizard inserts style link clause here -->
</rw:style>

</head>


<body>

<rw:dataArea id="yourDataArea">
   <!-- Report Wizard inserts the default jsp here -->
</rw:dataArea>



</body>
</html>

<!--
</rw:report> 
-->
]]>
  </webSource>
  <reportPrivate versionFlags2="0" templateName="rwbeige"/>
  <reportWebSettings>
  <![CDATA[]]>
  </reportWebSettings>
</report>
Image data is encoded in hexadecimal format (base16) but the hex digits are reversed compared to the original byte sequence.
For example, the first eight bytes in the source are :
FFD8FFE0 00104A46
but appears as
FF8DFF0E 0001A464
in the XML file.

You'll need a small program to read the file, extract the hex binary stream, process it and write back the data to a file.

Example in PL/SQL (tested on db version 11.2.0.2) :
DECLARE

 fid     utl_file.file_type;
 len     PLS_INTEGER := 1024;
 buf     RAW(512);
 
 module_name VARCHAR2(260) := 'MODULE1';
 dir_name    VARCHAR2(30) := 'TEST_DIR';

BEGIN

  for r in (
    /* extract all image elements */
    select img_name
         , regexp_replace(img_data, '\s+') as img_data
    from xmltable('//body/image'
          passing xmltype(bfilename(dir_name, module_name||'.xml'), nls_charset_id('WE8MSWIN1252'))
          columns img_name varchar2(30) path '@name'
                , img_data clob         path 'binaryData'
         )
  )
  loop
    /* output file */
    fid := utl_file.fopen(dir_name, module_name || '_' || r.img_name || '.jpg', 'wb', 32767); 

    for i in 0..trunc((dbms_lob.getlength(r.img_data) - 1 )/len)
    loop
      
      /* read 1k of hex data and convert to binary */
      buf := hextoraw(
               regexp_replace(
                 dbms_lob.substr(r.img_data, len, i*len + 1)
               , '(.)(.)'
               , '\2\1'
               )
             );
      
      utl_file.put_raw(fid, buf);
      
    end loop;
    
    utl_file.fclose(fid);
  
  end loop;

END;
/
Marked as Answer by 971919 · Sep 27 2020
971919
Odie,

This was what I was looking for!

I now wonder why I didn't notice that it was this simple!

Regards, Herman
1 - 2

Post Details

Added on Jun 11 2019
0 comments
4,218 views