Create Non-Replicated TimesTen Databases

This example shows you how to create non-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 non-replicated configuration.
    vi customyaml/norepsamplehelm.yaml
    
    storageClassName: oci-bv
    storageSize: 10Gi
    image:
      repository: container-registry.oracle.com/timesten/timesten
      tag: "22.1.1.27.0"
    imagePullSecret: sekret
    replicationTopology: none
    replicas: 3
    rollingUpdatePartition: 2
    dbConfigMap:
      - name: norepsamplehelm
      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.

    • For a non-replicated configuration:

      • The replicationTopology is none, indicating a non-replicated configuration consisting of replicas number of Pods. Each Pod contains an independent TimesTen database.

      • The number of replicas is 3, indicating the number of Pods, each of which contains a TimesTen database. Replace 3 with the number of Pods you want provisioned. Valid values are between 1 and 3, with 1 being the default.

      • The rollingUpdatePartition is 2. This variable is specific to upgrades and determines the number of TimesTen databases to upgrade. Kubernetes upgrades Pods with an ordinal value that is greater than or equal to the rollingUpdatePartition value. For example, if you have three non-replicated Pods (replicas = 3 and Pods are norepsamplehelm-0, norepsamplehelm-1, and norepsamplehelm-2) and you set rollingUpdatePartition to 2, the norepsamplehelm-2 Pods is upgraded, but the norepsamplehelm-1 and norepsamplehelm-0 Pods are not. There are examples in the upgrade section that show you how rollingUpdatePartition works. You have the option of changing the value during the upgrade process.
    • The name of the ConfigMap is norepsamplehelm. 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/norepsamplehelm.yaml norepsamplehelm ./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 norepsamplehelm.yaml, which is located in the customyaml directory.

    • The name of the release is norepsamplehelm.

    • 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: norepsamplehelm
    LAST DEPLOYED: Sun Aug  4 17:42:47 2024
    NAMESPACE: default
    STATUS: deployed
    REVISION: 1
    NOTES:
    Version 2211270.1.0 of the ttclassic chart has been installed.
    
    This release is named "norepsamplehelm".
    
    To learn more about the release, try:
    
      $ helm status norepsamplehelm
      $ helm get all norepsamplehelm
      $ helm history norepsamplehelm
    
    To rollback to a previous version of the chart, run:
    
      $ helm rollback norepsamplehelm <REVISION>
        - run 'helm history norepsamplehelm' 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 norepsamplehelm.

    • 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
    norepsamplehelm default         1               2024-08-04 17:42:47.180635098 +0000 UTC deployed        ttclassic-2211270.1.0   22.1.1.26.0

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

  5. Monitor the progress.
    NAME              STATE             ACTIVE   AGE
    norepsamplehelm   NoReplicasReady   N/A      94s
    

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

    Wait a few minutes. Then, check again.
    kubectl get ttc norepsamplehelm
    The output is similar to the following:
    NAME              STATE              ACTIVE   AGE
    norepsamplehelm   AllReplicasReady   N/A      12m
    

    The provisioning process completes. Databases are up and running and operational as indicated by the AllReplicasReady state.

  6. Confirm the ConfigMap and the metadata files exist.
    kubectl get configmap norepsamplehelm
    The output is similar to the following:
    NAME              DATA   AGE
    norepsamplehelm   4      15m
    

    Check the metadata files.

    kubectl describe configmap norepsamplehelm

    The output is similar to the following:

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

    The norepsamplehelm ConfigMap exists and contains the metadata files. Since the testUser file exists, you can use Helm to test TimesTen. See Test TimesTen for a Non-Replicated Configuration.

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

    There are three Pod running in your namespace, each of which contains an independent TimesTen database.

Congratulations! You successfully installed the ttclassic chart for a non-replicated configuration. TimesTen databases are up and running and fully operational.