Skip to content

Commit 93f6104

Browse files
committed
add connection file
1 parent 94fef3a commit 93f6104

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

.DS_Store

0 Bytes
Binary file not shown.

deploy/.DS_Store

0 Bytes
Binary file not shown.

deploy/dataconnect.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
3+
# ==============================================================================
4+
# Script Name: create-rhoai-connection-v2.sh
5+
# Description: Creates a fully UI-visible S3 Data Connection for RHOAI 3.x
6+
# Now includes the critical 'connection-type' linkage.
7+
# Usage: ./create-rhoai-connection-v2.sh <project-name> <connection-name>
8+
# ==============================================================================
9+
10+
11+
if [ "$#" -ne 2 ]; then
12+
echo "Usage: $0 <project-name> <connection-name>"
13+
exit 1
14+
fi
15+
16+
PROJECT_NAME=$1
17+
CONNECTION_NAME=$2
18+
19+
# --- CONFIGURATION ---
20+
AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-minio}"
21+
AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY:-minio123}"
22+
AWS_S3_ENDPOINT="${AWS_S3_ENDPOINT:-http://minio-service.$PROJECT_NAME.svc.cluster.local:9000}"
23+
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
24+
AWS_S3_BUCKET="${AWS_S3_BUCKET:-private-models}"
25+
# ---------------------
26+
27+
echo "Creating UI-Visible Data Connection '$CONNECTION_NAME'..."
28+
29+
cat <<EOF | oc apply -n "$PROJECT_NAME" -f -
30+
apiVersion: v1
31+
kind: Secret
32+
metadata:
33+
name: $CONNECTION_NAME
34+
labels:
35+
opendatahub.io/dashboard: "true"
36+
opendatahub.io/managed: "true" # <-- ADDED: 3.3 UI Visibility Requirement
37+
annotations:
38+
opendatahub.io/connection-type: "s3"
39+
opendatahub.io/connection-type-protocol: "s3" # <-- ADDED: 3.3 Backend Routing Requirement
40+
openshift.io/display-name: "private-models"
41+
openshift.io/description: "Read-only access to the corporate data lake."
42+
type: Opaque
43+
stringData:
44+
AWS_ACCESS_KEY_ID: "$AWS_ACCESS_KEY_ID"
45+
AWS_SECRET_ACCESS_KEY: "$AWS_SECRET_ACCESS_KEY"
46+
AWS_S3_ENDPOINT: "$AWS_S3_ENDPOINT"
47+
AWS_DEFAULT_REGION: "$AWS_DEFAULT_REGION"
48+
AWS_S3_BUCKET: "$AWS_S3_BUCKET"
49+
EOF
50+
51+
if [ $? -eq 0 ]; then
52+
echo "✅ Success! Connection '$CONNECTION_NAME' created and linked to type 's3'."
53+
else
54+
echo "❌ Error creating connection."
55+
fi

deploy/infrastructure/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)