Create Replicated TimesTen Databases

This example shows you how to create replicated TimesTen Classic databases using the ttclassic Helm chart. The example uses a YAML manifest file and assumes you have created the kube_files/helm/customyaml directory for the file.

  1. On your development host, change to the helm directory.
    cd kube_files/helm
  2. Create a YAML file that defines the variables for your replicated configuration.
    vi customyaml/repsamplehelm.yaml
    
    storageClassName: oci-bv
    storageSize: 10Gi
    image:
      repository: container-registry.oracle.com/timesten/timesten
      tag: "22.1.1.27.0"
    imagePullSecret: sekret
    replicationTopology: activeStandbyPair
    dbConfigMap:
      - name: repsamplehelm
      directory: cm
    Note the following:
    • The storageClassName is oci-bv. Replace oci-bv with the name of your storage class.

    • The storageSize is 10Gi. Replace 10Gi with the amount of storage that needs to be requested for each Pod to hold TimesTen.

    • For the image variable:
      • repository: The repository is container-registry.oracle.com/timesten/timesten. Replace container-registry.oracle.com/timesten/timesten with the name and location of your TimesTen container image.

      • tag: The tag is 22.1.1.27.0. Replace tag with the tag for the TimesTen release.

    • The imagePullSecret is sekret. Replace sekret with the image pull secret that Kubernetes needs to use to fetch the TimesTen container image.

    • The replicationTopology is activeStandbyPair, indicating a replicated configuration consisting of an active standby pair of TimesTen databases.
    • The name of the ConfigMap is repsamplehelm. The location of the metadata files is in the cm directory, which is located within the kube_file/helm/ttclassic directory tree..
  3. Install the ttclassic chart.
    helm install -f customyaml/repsamplehelm.yaml repsamplehelm ./ttclassic
    Let's look at this helm install command:
    • The -f option indicates that a YAML file is passed to the helm install command.

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

    • The name of the release is repsamplehelm.

    • The name of the chart is ttclassic, which is located in the kube_files/helm/ttclassic directory.

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

    NAME: repsamplehelm
    LAST DEPLOYED: Sun Aug  4 14:58:40 2024
    NAMESPACE: default
    STATUS: deployed
    REVISION: 1
    NOTES:
    Version 2211270.1.0 of the ttclassic chart has been installed.
    
    This release is named "repsamplehelm".
    
    To learn more about the release, try:
    
      $ helm status repsamplehelm
      $ helm get all repsamplehelm
      $ helm history repsamplehelm
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback repsamplehelm <REVISION>
        - run 'helm history repsamplehelm' for a list of revisions.
    
    Note the following:
    • The ttclassic chart version is 2211270.1.0, corresponding to TimesTen release 22.1.1.27.0.

    • The release name is repsamplehelm.

    • The status of the release is deployed.

  4. (Optional) Verify the release.
    helm list
    The output is similar to the following:
    NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
    repsamplehelm   default         1               2024-08-04 14:58:40.109402333 +0000 UTC deployed        ttclassic-2211270.1.0   22.1.1.27.0
    ...

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

  5. Monitor the progress.
    kubectl get ttc repsamplehelm
    The output is similar to the following:
    NAME            STATE          ACTIVE   AGE
    repsamplehelm   Initializing   None     44s

    The provisioning starts, but is not yet complete as indicated by the Initializing state.

    Wait a few minutes. Then, check again.
    kubectl get ttc repsamplehelm
    The output is similar to the following:
    NAME            STATE    ACTIVE            AGE
    repsamplehelm   Normal   repsamplehelm-0   4m23s

    The provisioning process completes. The active standby pair of TimesTen databases are up and running and operational as indicated by the Normal state.

  6. Confirm the ConfigMap and the metadata files exist.
    kubectl get configmap repsamplehelm
    The output is similar to the following:
    NAME            DATA   AGE
    repsamplehelm   4      8m50s

    Check the metadata files.

    kubectl describe configmap repsamplehelm

    The output is similar to the following:

    Name:         repsamplehelm
    Namespace:    default
    Labels:       app.kubernetes.io/managed-by=Helm
    Annotations:  meta.helm.sh/release-name: repsamplehelm
                  meta.helm.sh/release-namespace: default
    
    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 repsamplehelm ConfigMap exists and contains the metadata files. Since the testUser file exists, you can use Helm to test TimesTen. See Test TimesTen for a Replicated Configuration.

  7. (Optional) Confirm the Pods.
    kubectl get pods
    The output is similar to the following:
    NAME                              READY   STATUS    RESTARTS   AGE
    repsamplehelm-0                   3/3     Running   0          11m
    repsamplehelm-1                   2/3     Running   0          11m
    ...

    The repsamplehelm-0 and repsamplehelm-1 Pods are running in your namespace. Each Pod is running TimesTen.

Congratulations! You successfully installed the ttclassic chart for a replicated configuration. An active standby pair of TimesTen Classic databases are up and running and fully operational.