Install in Namespace One

Let's install the TimesTen Operator in a namespace called mynamespace in your Kubernetes cluster at namespace-scoped.

  1. Switch to namespace one (mynamespace, in this example).
    kubectl config set-context --current --namespace=mynamespace

    The output is similar to the following:

    Context "default" modified.
  2. Change to the directory that contains the YAML manifest files. In this example, the kube_files/deploy contains the files.
    cd kube_files/deploy
  3. Install the required service account, role, and role binding.
    kubectl create -f service_account.yaml

    The output is similar to the following:

    role.rbac.authorization.k8s.io/timesten-operator created
    serviceaccount/timesten-operator created
    rolebinding.rbac.authorization.k8s.io/timesten-operator created
    
  4. Make a copy of the service_account_cluster.yaml file for the first namespace (service_account_cluster_n1.yaml, in this example).
    cp service_account_cluster.yaml service_account_cluster_n1.yaml
  5. Install the service_account_cluster_n1.yaml YAML file by doing the following:
    1. (Optional): Display the contents of the service_account_cluster_n1.yaml file.
      cat service_account_cluster_n1.yaml
      The output is similar to the following:
      # Copyright (c) 2025, Oracle and/or its affiliates.
      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRole
      metadata:
        name: timesten-operator
        # If running multiple operators on the same cluster:
        #name: timesten-operator-<NAMESPACE>
      rules:
      - apiGroups:
        - ""
        resources:
        - nodes
        verbs:
        - get
        - list
        - watch
      - apiGroups:
        - ""
        resources:
        - persistentvolumeclaims
        verbs:
        - get
        - list
        - watch
        - delete
      ---
      kind: ClusterRoleBinding
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: timesten-operator
        # If running multiple operators on the same cluster:
        #name: timesten-operator-<NAMESPACE>
      subjects:
      - kind: ServiceAccount
        name: timesten-operator
        #namespace: <NAMESPACE>
      roleRef:
        kind: ClusterRole
        name: timesten-operator
        # If running multiple operators on the same cluster:
        #name: timesten-operator-<NAMESPACE>
        apiGroup: rbac.authorization.k8s.io
    2. Use a text editor to modify the service_account_cluster_n1.yaml file.
      Make the following changes:
      • Locate #namespace, remove #, and replace <NAMESPACE> with the name of your namespace (mynamespace, in this example).

      • Locate the three occurrences of #name, remove #, and replace <NAMESPACE> with the name of your namespace (mynamespace, in this example).

      vi service_account_cluster_n1.yaml
      
      # Copyright (c) 2025, Oracle and/or its affiliates.
      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRole
      metadata:
        name: timesten-operator
        # If running multiple operators on the same cluster:
        name: timesten-operator-mynamespace
      rules:
      - apiGroups:
        - ""
        resources:
        - nodes
        verbs:
        - get
        - list
        - watch
      - apiGroups:
        - ""
        resources:
        - persistentvolumeclaims
        verbs:
        - get
        - list
        - watch
        - delete
      ---
      kind: ClusterRoleBinding
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: timesten-operator
        # If running multiple operators on the same cluster:
        name: timesten-operator-mynamespace
      subjects:
      - kind: ServiceAccount
        name: timesten-operator
        namespace: mynamespace
      roleRef:
        kind: ClusterRole
        name: timesten-operator
        # If running multiple operators on the same cluster:
        name: timesten-operator-mynamespace
        apiGroup: rbac.authorization.k8s.io
    3. Save and close the service_account_cluster_n1.yaml file.
    4. Install the service_account_cluster_n1.yaml file.
      kubectl create -f service_account_cluster_n1.yaml
      The output is similar to the following:
      clusterrole.rbac.authorization.k8s.io/timesten-operator created
      clusterrolebinding.rbac.authorization.k8s.io/timesten-operator created
  6. Modify the operator.yaml file by doing the following:
    1. Use a text editor to modify the operator.yaml file.

      Replace the following:

      • image: Replace container-registry.oracle.com/timesten/timesten:latest with the name of your image. In this example, the name of the image is container-registry.oracle.com/timesten/timesten:22.1.1.34.0.

      • imagePullSecrets: Replace sekret with the name of your image pull secret. In this example, the name of the image pull secret is sekret.

      • If you are running in a multi-architecture environment, modify the affinity section, and specify either amd64 or arm64. This example assumes you are running in a multi-architecture environment and sets nodes to amd64.

      vi operator.yaml
      
      # Copyright (c) 2019 - 2025, Oracle and/or its affiliates.
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: timesten-operator
      spec:
        replicas: 1
      ...
          spec:
            serviceAccountName: timesten-operator
            imagePullSecrets:
            - name: sekret
            containers:
              - name: timesten-operator
                image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0
      ...
      # An example affinity definition; this pod will only be assigned to a node
      # running on amd64 (the default)
      #
            affinity:
              nodeAffinity:
                requiredDuringSchedulingIgnoredDuringExecution:
                  nodeSelectorTerms:
                    - matchExpressions:
                      - key: "kubernetes.io/arch"
                        operator: In
                        values: ["amd64"]
    2. Save and close the operator.yaml file.
  7. Install the TimesTen Operator.
    kubectl create -f operator.yaml
    The output is the following:
    deployment.apps/timesten-operator created
  8. Verify the TimesTen Operator is running.
    kubectl get pods
    The output is similar to the following:
    NAME                                 READY   STATUS    RESTARTS   AGE
    timesten-operator-577f7fbc6f-tbr7m   1/1     Running   0          61s
Congratulations! You installed the TimesTen Operator into a namespace (called mynamespace) in your Kubernetes cluster at namespace-scope.