Skip to content

Commit a4d8334

Browse files
Mo3m3nRoming22
authored andcommitted
Add pipeline-service-storage argocd app
The pipeline-service-storage app will install both postgres and minio used only for development purpose
1 parent 00c133c commit a4d8334

File tree

13 files changed

+42
-68
lines changed

13 files changed

+42
-68
lines changed

developer/config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ git_ref: main
1414
# Applications to be deployed on the cluster
1515
apps:
1616
- openshift-gitops # openshift-gitops is a pre-requisite for Pipeline Service
17-
- minio # for development purposes, install minio as the storage backend for tekton-results
1817
- pipeline_service # pipeline_service sets up Pipeline Service on the cluster.
1918

2019
# Tekton results database credentials
@@ -23,6 +22,6 @@ tekton_results_db:
2322
password:
2423

2524
# Minio S3 compatible storage credentials for tekton results
26-
tekton_results_log:
25+
tekton_results_s3:
2726
user:
2827
password:

developer/openshift/dev_setup.sh

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -195,57 +195,6 @@ install_openshift_gitops() {
195195
fi
196196
}
197197

198-
install_minio() {
199-
local APP="minio"
200-
201-
#############################################################################
202-
# Install the minio operator
203-
#############################################################################
204-
205-
echo -n "- Secret: "
206-
TEKTON_RESULTS_MINIO_USER="$(yq '.tekton_results_log.user // "minio"' "$CONFIG")"
207-
TEKTON_RESULTS_MINIO_PASSWORD="$(yq ".tekton_results_log.password // \"$(openssl rand -base64 20)\"" "$CONFIG")"
208-
209-
COMPUTE_DIR="$WORK_DIR"/credentials/manifests/compute/tekton-results
210-
mkdir -p "$COMPUTE_DIR"
211-
212-
minio_configuration_secret="minio-storage-configuration"
213-
# secret with minio tenant configuration
214-
results_minio_conf_secret_path="$COMPUTE_DIR/${minio_configuration_secret}.yaml"
215-
216-
minio_credentials_secret="s3-credentials"
217-
# secret with minio credentials for tekton-results api server
218-
results_minio_cred_secret_path="$COMPUTE_DIR/${minio_credentials_secret}.yaml"
219-
220-
export TEKTON_RESULTS_MINIO_USER
221-
export TEKTON_RESULTS_MINIO_PASSWORD
222-
minio_conf_template="$DEV_DIR/gitops/argocd/pipeline-service/tekton-results/templates/${minio_configuration_secret}.yaml"
223-
envsubst < "$minio_conf_template" > "$results_minio_conf_secret_path"
224-
# unset env variables, but save their values
225-
export -n TEKTON_RESULTS_MINIO_USER
226-
export -n TEKTON_RESULTS_MINIO_PASSWORD
227-
228-
kubectl create secret generic "${minio_credentials_secret}" \
229-
--from-literal=S3_ACCESS_KEY_ID="$TEKTON_RESULTS_MINIO_USER" \
230-
--from-literal=S3_SECRET_ACCESS_KEY="$TEKTON_RESULTS_MINIO_PASSWORD" \
231-
-n tekton-results --dry-run=client -o yaml >> "$results_minio_cred_secret_path"
232-
233-
kubectl apply -f "$PROJECT_DIR/operator/gitops/argocd/pipeline-service/tekton-results/base/namespace.yaml" >/dev/null
234-
kubectl apply -f "$results_minio_conf_secret_path" >/dev/null
235-
kubectl apply -f "$results_minio_cred_secret_path" >/dev/null
236-
echo "OK"
237-
238-
echo -n "- Installing minio: "
239-
kubectl apply -f "$DEV_DIR/gitops/argocd/$APP/application.yaml" >/dev/null
240-
echo "OK"
241-
242-
# Subscription information for potential debug
243-
mkdir -p "$WORK_DIR/logs/$APP"
244-
245-
echo "- Checking deployment status:"
246-
check_deployments "openshift-operators" "minio-operator" | indent 2
247-
check_pod_by_label "tekton-results" "app=minio" | indent 2
248-
}
249198

250199
setup_compute_access() {
251200
if [ -n "${USE_CURRENT_BRANCH:-}" ]; then
@@ -263,10 +212,18 @@ setup_compute_access() {
263212

264213
install_pipeline_service() {
265214

215+
#############################################################################
216+
# Setup working directory
217+
#############################################################################
218+
266219
TEKTON_RESULTS_DATABASE_USER="$(yq '.tekton_results_db.user' "$CONFIG")"
267220
TEKTON_RESULTS_DATABASE_PASSWORD="$(yq '.tekton_results_db.password' "$CONFIG")"
268221
export TEKTON_RESULTS_DATABASE_USER
269222
export TEKTON_RESULTS_DATABASE_PASSWORD
223+
TEKTON_RESULTS_S3_USER="$(yq '.tekton_results_s3.user // "minio"' "$CONFIG")"
224+
TEKTON_RESULTS_S3_PASSWORD="$(yq ".tekton_results_s3.password // \"$(openssl rand -base64 20)\"" "$CONFIG")"
225+
export TEKTON_RESULTS_S3_USER
226+
export TEKTON_RESULTS_S3_PASSWORD
270227

271228
echo "- Setup working directory:"
272229
"$PROJECT_DIR/operator/images/access-setup/content/bin/setup_work_dir.sh" \
@@ -275,8 +232,9 @@ install_pipeline_service() {
275232
--kustomization "git::$GIT_URL/developer/openshift/gitops/argocd?ref=$GIT_REF" |
276233
indent 2
277234

278-
echo "- Installing local postgres DB for tekton results:"
279-
kubectl apply -f "$PROJECT_DIR/developer/local/postgres" | indent 4
235+
#############################################################################
236+
# Deploy Applications
237+
#############################################################################
280238

281239
echo "- Deploy applications:"
282240
if [ -n "${USE_CURRENT_BRANCH:-}" ]; then
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
resources:
3+
- pipeline-service-storage.yaml
34
- pipeline-service.yaml
45
apiVersion: kustomize.config.k8s.io/v1beta1
56
kind: Kustomization

developer/openshift/gitops/argocd/minio/application.yaml renamed to developer/openshift/gitops/argocd/pipeline-service-storage.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
apiVersion: argoproj.io/v1alpha1
33
kind: Application
44
metadata:
5-
name: minio
5+
name: pipeline-service-storage
66
namespace: openshift-gitops
77
spec:
88
destination:
99
namespace: openshift-gitops
1010
server: https://kubernetes.default.svc
1111
source:
12-
path: developer/openshift/gitops/argocd/minio
12+
path: developer/openshift/gitops/argocd/pipeline-service-storage
1313
repoURL: https://github.com/openshift-pipelines/pipeline-service.git
1414
targetRevision: main
1515
project: default
@@ -22,8 +22,6 @@ spec:
2222
selfHeal: true
2323
syncOptions:
2424
- CreateNamespace=true
25-
# workaround to make working both minio: newer and old 4.5.4
26-
- Validate=false
2725
retry:
2826
limit: -1 # number of failed sync attempt retries; unlimited number of attempts if less than 0
2927
backoff:

developer/openshift/gitops/argocd/minio/kustomization.yaml renamed to developer/openshift/gitops/argocd/pipeline-service-storage/kustomization.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44

55
resources:
6-
- operator
7-
- tenant
6+
- postgres
7+
- minio/operator
8+
- minio/tenant

0 commit comments

Comments
 (0)