|
| 1 | +================================= |
| 2 | +Setup using Helm Charts |
| 3 | +================================= |
| 4 | + |
| 5 | +We always suggest to deploy feature store via the :doc:`Feature Store Operator <./user_guides.setup.feature_store_operator>` to setup Feature Store API server in OKE Cluster. This method should preferably be used only when the operator can not satisfy your requirements |
| 6 | +as it is much simpler to do the setup via the operator. |
| 7 | + |
| 8 | + |
| 9 | +Prerequisites |
| 10 | +_____________ |
| 11 | + |
| 12 | +- Setup `MySQL Database <https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/mysql-database/doc/overview-mysql-database-service.html>`_ so that it is reachable from the API server |
| 13 | +.. seealso:: |
| 14 | + :ref:`Database configuration` |
| 15 | +- :ref:`Helm Setup` |
| 16 | +- :ref:`Policies` |
| 17 | +- `Setup cluster access locally <https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengdownloadkubeconfigfile.htm#:~:text=Under%20Containers%20%26%20Artifacts%2C%20click%20Kubernetes,shows%20details%20of%20the%20cluster>`_ |
| 18 | + |
| 19 | +Steps to deploy API server image |
| 20 | +________________________________ |
| 21 | + |
| 22 | +- Export the package to OCIR using the `Feature store marketplace listing <https://cloud.oracle.com/marketplace/application/ocid1.mktpublisting.oc1.iad.amaaaaaabiudgxya26lzh2dsyvg7cfzgllvdl6xo5phz4mnsoktxeutecrvq>`_ |
| 23 | +- Wait for export work request to complete |
| 24 | +- Identify the Helm chart and API images exported to OCIR: |
| 25 | + - Helm chart image would be of format: ``<ocir-image>:<version>`` |
| 26 | + - API image would be of format: ``<ocir-image>:<export-number>-<image-id>-<tenancy-namespace>-feature-store-api-<version>`` |
| 27 | + |
| 28 | +- :ref:`Create kubernetes docker secret <Kubernetes secret>` |
| 29 | + |
| 30 | +- :ref:`Generate custom values.yaml for deployment <Helm values>` |
| 31 | + |
| 32 | +- Install the helm chart |
| 33 | + |
| 34 | +.. code-block:: bash |
| 35 | +
|
| 36 | + helm upgrade feature-store-api oci://<helm-chart-image-path> --namespace feature-store --values <path-to-values-yaml> --timeout 300s --wait -i |
| 37 | +- (Optional) `Setup Feature Store API Gateway <https://github.com/oracle-samples/oci-data-science-ai-samples/tree/main/feature_store/apigw_terraform>`_ |
| 38 | + |
| 39 | + |
| 40 | +Appendix |
| 41 | +________ |
| 42 | + |
| 43 | +.. _Helm Setup: |
| 44 | + |
| 45 | +Setup Helm to use OCIR |
| 46 | +______________________ |
| 47 | + |
| 48 | +To login to Container Registry using the Helm CLI: |
| 49 | + |
| 50 | +- If you already have an auth token, go to the next step. Otherwise: |
| 51 | + - In the top-right corner of the Console, open the Profile menu and then click User settings to view the details. |
| 52 | + - On the Auth Tokens page, click Generate Token. |
| 53 | + - Enter a friendly description for the auth token. Avoid entering confidential information. |
| 54 | + - Click Generate Token. The new auth token is displayed. |
| 55 | + - Copy the auth token immediately to a secure location from where you can retrieve it later, because you won't see the auth token again in the Console. |
| 56 | + - Close the Generate Token dialog. |
| 57 | + |
| 58 | +- In a terminal window on the client machine running Docker, log in to Container Registry by entering ``helm registry login <region-key>.ocir.io``, where <region-key> corresponds to the key for the Container Registry region you're using. For example, ``helm registry login iad.ocir.io``. See `Availability by Region <https://docs.oracle.com/en-us/iaas/Content/Registry/Concepts/registryprerequisites.htm#regional-availability>`_. |
| 59 | +- When prompted for a username, enter your username in the format <tenancy-namespace>/<username>, where <tenancy-namespace> is the auto-generated Object Storage namespace string of your tenancy (as shown on the Tenancy Information page). For example, ansh81vru1zp/jdoe@acme.com. If your tenancy is federated with Oracle Identity Cloud Service, use the format <tenancy-namespace>/oracleidentitycloudservice/<username>. |
| 60 | +- When prompted for a password, enter the auth token you copied earlier. |
| 61 | + |
| 62 | +.. _Kubernetes secret: |
| 63 | + |
| 64 | +Kubernetes Docker Secret Configuration |
| 65 | +__________________________________________________________ |
| 66 | +- If you don't already have an auth token refer :ref:`<helm setup>` |
| 67 | +- `Login to Kubernetes cluster <https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengdownloadkubeconfigfile.htm#:~:text=Under%20Containers%20%26%20Artifacts%2C%20click%20Kubernetes,shows%20details%20of%20the%20cluster>`_ |
| 68 | +- Run command |
| 69 | + |
| 70 | +.. code-block:: bash |
| 71 | +
|
| 72 | + kubectl create secret docker-registry <secret-name> --docker-server=<region-key>.ocir.io --docker-username=<tenancy-namespace>/<username> --docker-password=<auth token> |
| 73 | +
|
| 74 | +.. _Helm values: |
| 75 | + |
| 76 | +Helm values configuration: |
| 77 | +__________________________________________________________ |
| 78 | + |
| 79 | +- Minimal Helm values example for getting started: |
| 80 | + |
| 81 | +.. code-block:: yaml |
| 82 | +
|
| 83 | + db: |
| 84 | + configuredDB: MYSQL |
| 85 | + mysql: |
| 86 | + authType: BASIC |
| 87 | + basic: |
| 88 | + password: #enter-db-password-here |
| 89 | + jdbcURL: jdbc:mysql://<db-ip>:3306/FeatureStore?createDatabaseIfNotExist=true |
| 90 | + username: #enter-db-username-here |
| 91 | + imagePullSecrets: |
| 92 | + - name: #enter secret name containing docker secret here |
| 93 | + oci_meta: |
| 94 | + images: |
| 95 | + repo: #ocir repo: <region-key>.ocir.io/<tenancy-namespace>/repository |
| 96 | + api: |
| 97 | + image: #ocir image: The name of image> |
| 98 | + tag: #API Image tag |
| 99 | + authoriser: |
| 100 | + image: na |
| 101 | + tag: na |
| 102 | + |
| 103 | +
|
| 104 | +
|
| 105 | +- All available Helm values |
| 106 | + |
| 107 | +.. code-block:: yaml |
| 108 | +
|
| 109 | + oci_meta: |
| 110 | + repo: #ocir repo: <region-key>.ocir.io/<tenancy-namespace>/repository |
| 111 | + images: |
| 112 | + api: |
| 113 | + image: #ocir image: The name of image |
| 114 | + tag: #API Image tag |
| 115 | + authoriser: # We don't want to deploy this image. This image will be deployed with OCI functions |
| 116 | + image: na |
| 117 | + tag: na |
| 118 | +
|
| 119 | + imagePullSecrets: |
| 120 | + - name: #name-of-docker-secret-with-credentials |
| 121 | +
|
| 122 | + db: |
| 123 | + configuredDB: #type of DB configured. possible values: "MYSQL" |
| 124 | + mysql: |
| 125 | + authType: #Type of authentication to use for connecting to database. |
| 126 | + # Possible values: 'BASIC', 'VAULT' |
| 127 | + jdbcURL: #JDBC URL of the MySQL server |
| 128 | + username: #Name of the user on MySQL server |
| 129 | + basic: |
| 130 | + password: #Password to mysql server in plain-text format |
| 131 | + vault: |
| 132 | + vaultOcid: #OCID of the vault where the secret is kept |
| 133 | + secretName: #Name of the secret used for connecting to vault |
| 134 | +
|
| 135 | + resources: #https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
| 136 | +
|
| 137 | + nameOverride: #Value for label app.kubernetes.io/name |
| 138 | +
|
| 139 | + podSecurityContext: #Pod security #https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ |
| 140 | +
|
| 141 | + securityContext: #Container Security context #https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ |
| 142 | +
|
| 143 | + deploymentStrategy: #This block is directly inserted into pod spec |
| 144 | + #https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ |
| 145 | +
|
| 146 | +
|
| 147 | + nodeSelector: {} #Pod node selector |
| 148 | + #https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ |
| 149 | +
|
| 150 | + tolerations: [] #Pod tolerations |
| 151 | + #https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ |
| 152 | +
|
| 153 | + affinity: {} #Pod affinity |
| 154 | + #https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ |
| 155 | +
|
| 156 | + replicaCount: #Pod replicas |
| 157 | + #https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ |
| 158 | +
|
| 159 | + autoscaling: #Horizontal pod scaling details |
| 160 | + #https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ |
| 161 | + enabled: |
| 162 | + minReplicas: |
| 163 | + maxReplicas: |
| 164 | + targetCPUUtilizationPercentage: |
| 165 | + targetMemoryUtilizationPercentage: |
| 166 | + scaleUp: |
| 167 | + stabilizationWindowSeconds: |
| 168 | + periodSeconds: |
| 169 | + podCount: |
| 170 | + percentage: |
| 171 | + scaleDown: |
| 172 | + stabilizationWindowSeconds: |
| 173 | + periodSeconds: |
| 174 | + podCount: |
| 175 | + percentage: |
| 176 | +
|
| 177 | + applicationEnv: |
| 178 | + containerName: #Container name |
| 179 | +
|
| 180 | + livenessProbe: # Liveness probe details |
| 181 | + initialDelaySeconds: |
| 182 | + periodSeconds: |
| 183 | + timeoutSeconds: |
| 184 | + failureThreshold: |
| 185 | +
|
| 186 | + readinessProbe: # Readiness probe details |
| 187 | + initialDelaySeconds: |
| 188 | + periodSeconds: |
| 189 | + timeoutSeconds: |
| 190 | + failureThreshold: |
| 191 | +
|
0 commit comments