Install TimesTen Databases

The ttclassic chart contains all the information necessary to deploy an active standby pair of TimesTen Classic databases in your namespace. The chart contains a default configuration for deploying TimesTen. You have the option of customizing the chart to meet your preferred configuration. Specifically, the TimesTen Operator provides several variables whose values you can change to meet your configuration needs. For information about these variables, see The ttclassic Chart.

When customizing your environment, consider the following:
  • The method you are using to place metadata files into the /ttconfig directory of TimesTen containers. If you are using Kubernetes ConfigMaps or Secrets:
    • You do not need to create them. The ttclassic chart installation generates ConfigMaps and Secrets for you.

    • You must create a directory in the helm/ttclassic directory tree of the ttclassic chart. Place all your metadata files in this directory. All of the files in this directory are added to the generated ConfigMap or Secret.

    • You must specify the dbConfigMap (if using a ConfigMap) or dbSecret (if using a Secret) variable in your customized YAML manifest file. For more information about these variables, see The ttclassic Chart.

    The example in this section illustrates how to use a ConfigMap for your metadata files. For more information about using ConfigMaps or Secrets, see Populate the /ttconfig Directory.

  • If you are using helm test to test TimesTen:

    • You must define a test user. The test connects to the TimesTen database as this user.

    • The TimesTen Operator provides a metadata file called testUser. Use this metadata file to define the test user. This file must contain one line of the form:
      testuser/testuserpassword

      where testuser is the name of your test user and testuserpassword is the password for this test user.

    For more information about testing TimesTen using Helm, see Test TimesTen.

After you decide the variables you want to customize, you have two options:
  • Create a YAML file that defines the variables that you want to use to configure your environment. Next, to install the chart, pass this YAML file to the helm install command by specifying the -f option.

  • Specify the variables on the command line by running the helm install command with the --set option.

For more information about these options, see https://helm.sh/docs/intro/using_helm/.

The examples in the section use a YAML file.

Let's walk through an example illustrating how to install the ttclassic chart, which deploys an active standby pair of TimesTen Classic databases. In this example, let's do the following:
  • Create a directory for the metadata files. In this example, the ttclassic chart installation generates a ConfigMap from the files in this directory.

  • Create the testUser metadata file. This file defines a test user. This user must be defined in order to test TimesTen using Helm.

  • Make modifications to the following ttclassic chart's variables:
    • imagePullSecret: Let's assume that sekret is the name of the Secret used to pull images from the repository. Therefore, let's specify sekret for the imagePullSecret variable.

    • Container image: Rather that use a container image in container-registry.oracle.com/timesten, let's assume you built you own container image as discussed in Option 2: Build the TimesTen Container Image. Let's assume the name of the container image you built and want to use is phx.ocir.io/youraccount/tt2211190image:1. Based on this container image, let's modify the following variables:
      • repository: For the repository variable, specify a value of phx.ocir.io/youraccount/tt2211190image.

      • tag: For the tag variable, specify a value of 1.

    • storageClassName: Let's specify oci-bv for the storage class name. Since there is no default for this variable, you must specify it.

    • storageSize: Rather than use the default value of 50Gi, let's specify a value of 10Gi for the storage size.
    • dbConfigMap: Since you are using a ConfigMap for the metadata files, you must specify the dbConfigMap variable. This variable requires that you specify a name for the ConfigMap as well as the directory where the metadata files are located. The use of this variable is shown later in this example.

In addition, lets' assume you have created a kube_files/helm/customyaml directory for your customized YAML files.

  1. On your development host, change to the helm directory. For more information about the helm directory, see Set Up the Environment.
    cd kube_files/helm
  2. Create a directory for the metadata files. The directory must be created in the directory tree of the /ttclassic chart.
    mkdir -p ttclassic/cm

    The cm directory is the directory that will contain the metadata files. When you install the ttclassic chart, a ConfigMap will be created and will contain the metadata files located in the directory. There are steps in this example that later illustrate this.

  3. Create the testUser metadata file.
    vi ttclassic/cm/testUser
    
    sampletestuser/sampletestuserpwd1
    In this example, the sampletestuser is the name of the test user that is used for testing TimesTen with the helm test command. The password for sampletestuser is sampletestuserpwd1. See Test TimesTen.
  4. (Optional) Create additional metadata files as needed.
    vi ttclassic/cm/adminUser
    
    adminuser/adminuserpwd
    vi ttclassic/cm/db.ini
    
    PermSize=200
    DatabaseCharacterSet=AL32UTF8
    vi ttclassic/cm/schema.sql
    
    create table adminuser.emp (id number not null primary key, name char (32));

    The cm directory contains the testUser, adminUser, db.ini, and schema.sql metadata files. A ConfigMap is the facility that will be used to place these metadata files in the /ttconfig directory of the TimesTen containers. For more information about metadata files and using a ConfigMap, see About Configuration Metadata Details and Populate the /ttconfig Directory.

  5. Create a YAML file that defines the variables for your configuration.
    vi customyaml/samplettc.yaml
    
    storageClassName: oci-bv
    storageSize: 10Gi
    image:
      repository: phx.ocir.io/youraccount/tt2211190image
      tag: "1"
      pullPolicy: Always
    imagePullSecret: sekret
    dbConfigMap:
      - name: samplettc
        directory: cm
    The customizations are as follows:
    • The storage class name is oci-bv.

    • The storage size is 10Gi.

    • Since the container image you built and want to use is phx.ocir.io/youraccount/tt2211190image:1, the value of the repository variable is phx.ocir.io/youraccount/tt2211190image and the value of the tag variable is 1.

    • The image pull Secret is sekret.

    • The name of the Kubernetes ConfigMap is samplettc. The location of the metadata files is the cm directory. This directory is located within the kube_files/helm/ttclassic directory tree.

  6. To deploy an active standby pair of TimesTen databases, install the ttclassic chart.
    helm install -f customyaml/samplettc.yaml samplettc ./ttclassic
    Let's look at this helm install command:
    • The -f option is used to pass the customized YAML file to the helm install command.

    • The name of the file that contains the customizations is samplettc.yaml, which is located in the customyaml directory.

    • The name of the release is samplettc.

    • The name of the chart that installs the TimesTen Operator is ttclassic, which is located in the helm/ttclassic directory.

    Let's look at the output from the helm install command.

    NAME: samplettc
    LAST DEPLOYED: Mon Oct 23 23:18:03 2023
    NAMESPACE: mynamespace
    STATUS: deployed
    REVISION: 1
    NOTES:
    Version 2211190.1.0 of the ttclassic chart has been installed.
    
    This release is named "samplettc".
    
    To learn more about the release, try:
    
      $ helm status samplettc
      $ helm get all samplettc
      $ helm history samplettc
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback samplettc <REVISION>
        - run 'helm history samplettc' for a list of revisions.
    Note the following:
    • The ttclassic chart version is 2211190.1.0 corresponding to the 22.1.1.19.0 TimesTen release.

    • The release name is samplettc.

    • The status of the release is deployed.

  7. (Optional) Verify the release.
    helm list
    Output.
    NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
    samplettc       mynamespace     1               2023-10-23 23:18:03.740512897 +0000 UTC deployed        ttclassic-2211190.1.0   22.1.1.19.0
    samplettop      mynamespace     1               2023-10-23 23:04:40.492890589 +0000 UTC deployed        ttoperator-2211190.1.0  22.1.1.19.0
    ttcrd           mynamespace     1               2023-10-17 22:00:53.530832896 +0000 UTC deployed        ttcrd-2211190.1.0       22.1.1.19.0

    The helm list command shows the samplettc release exists and is installed in your namespace.

  8. Wait a few minutes, then confirm the TimesTenClassic object is deployed in your namespace and is in the Normal state.
    kubectl get ttc samplettc

    Output.

    NAME        STATE    ACTIVE        AGE
    samplettc   Normal   samplettc-0   114s

    The samplettc TimesTenClassic object is deployed and is in the Normal state.

  9. Confirm the ConfigMap was created and the metadata files are in the ConfigMap.
    kubectl get configmap samplettc

    Output.

    NAME        DATA   AGE
    samplettc   4      2m17s

    Check metadata files.

    kubectl describe configmap samplettc

    Output.

    Name:         samplettc
    Namespace:    mynamespace
    Labels:       app.kubernetes.io/managed-by=Helm
    Annotations:  meta.helm.sh/release-name: samplettc
                  meta.helm.sh/release-namespace: mynamespace
    
    Data
    ====
    adminUser:
    ----
    adminuser/adminuserpwd
    
    db.ini:
    ----
    PermSize=200
    DatabaseCharacterSet=AL32UTF8
    
    schema.sql:
    ----
    create table adminuser.emp (id number not null primary key, name char (32));
    
    testUser:
    ----
    sampletestuser/sampletestuserpwd1
    
    
    BinaryData
    ====
    
    Events:  <none>

    The samplettc ConfigMap was created and the metadata files are included in the ConfigMap. Since the testUser is defined, you can use Helm to test TimesTen. See Test TimesTen.

  10. (Optional) Confirm the active and standby Pods are running.
    kubectl get pods

    Output.

    NAME                                  READY   STATUS    RESTARTS   AGE
    samplettc-0                           3/3     Running   0          2m51s
    samplettc-1                           3/3     Running   0          2m41s
    timesten-operator-65ddf9cfbb-jkqbn    1/1     Running   0          12m

    The samplettc-0 and samplettc-1 Pods are running in your namespace.

Congratulations! You successfully installed the ttclassic chart. An active standby pair of TimesTen Classic databases is deployed in your namespace. Both the active and standby databases are up and running.