Skip to content

Commit 43e7680

Browse files
committed
Fix tekton results storage configurations
* Add minio user creation through tenant, and disable TLS * Add minio and postgres as multiple sources in pipeline storage ArgoCD application * Increase timeouts * Fix reset script
1 parent b8fb576 commit 43e7680

File tree

21 files changed

+223
-289
lines changed

21 files changed

+223
-289
lines changed

developer/openshift/dev_setup.sh

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ install_pipeline_service() {
227227
TEKTON_RESULTS_DATABASE_PASSWORD="$(yq '.tekton_results_db.password' "$CONFIG")"
228228
export TEKTON_RESULTS_DATABASE_USER
229229
export TEKTON_RESULTS_DATABASE_PASSWORD
230-
TEKTON_RESULTS_S3_USER="$(yq '.tekton_results_s3.user // "minio"' "$CONFIG")"
230+
TEKTON_RESULTS_S3_USER="$(yq '.tekton_results_s3.user // "tekton"' "$CONFIG")"
231231
TEKTON_RESULTS_S3_PASSWORD="$(yq ".tekton_results_s3.password // \"$(openssl rand -base64 20)\"" "$CONFIG")"
232232
export TEKTON_RESULTS_S3_USER
233233
export TEKTON_RESULTS_S3_PASSWORD
@@ -244,17 +244,14 @@ install_pipeline_service() {
244244
for app in "pipeline-service" "pipeline-service-storage"; do
245245
cat << EOF >"$manifest_dir/patch-$app.yaml"
246246
---
247-
apiVersion: argoproj.io/v1alpha1
248-
kind: Application
249-
metadata:
250-
name: $app
251-
namespace: openshift-gitops
252-
spec:
253-
source:
254-
repoURL: $GIT_URL
255-
targetRevision: $GIT_REF
247+
- op: replace
248+
path: "/spec/sources/0/repoURL"
249+
value: $GIT_URL
250+
- op: replace
251+
path: "/spec/sources/0/targetRevision"
252+
value: $GIT_REF
256253
EOF
257-
yq -i ".patches += [{\"path\": \"patch-$app.yaml\"}]" "$manifest_dir/kustomization.yaml"
254+
yq -i ".patches += [{\"path\": \"patch-$app.yaml\", \"target\": {\"kind\": \"Application\", \"namespace\": \"openshift-gitops\", \"name\": \"$app\" }}]" "$manifest_dir/kustomization.yaml"
258255
done
259256

260257
#############################################################################

developer/openshift/gitops/argocd/pipeline-service-storage.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ metadata:
66
namespace: openshift-gitops
77
spec:
88
destination:
9-
namespace: openshift-gitops
9+
namespace: tekton-results
1010
server: https://kubernetes.default.svc
11-
source:
12-
path: developer/openshift/gitops/argocd/pipeline-service-storage
13-
repoURL: https://github.com/openshift-pipelines/pipeline-service.git
14-
targetRevision: main
11+
sources:
12+
- repoURL: https://github.com/openshift-pipelines/pipeline-service.git
13+
path: developer/openshift/gitops/argocd/pipeline-service-storage/minio
14+
targetRevision: main
15+
ref: values
16+
- repoURL: https://charts.bitnami.com/bitnami
17+
chart: postgresql
18+
targetRevision: 12.2.7
19+
helm:
20+
releaseName: postgres
21+
valueFiles:
22+
- $values/developer/openshift/gitops/argocd/pipeline-service-storage/postgres/values.yaml
1523
project: default
1624
syncPolicy:
1725
# Comment this out if you want to manually trigger deployments (using the

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

Lines changed: 0 additions & 7 deletions
This file was deleted.

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

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

55
resources:
66
- operator

developer/openshift/gitops/argocd/pipeline-service-storage/minio/operator/allow-argocd-to-manage.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
name: openshift-minio-apply-tenants
5+
name: openshift-gitops-minio
66
rules:
77
- apiGroups:
88
- minio.min.io
@@ -19,23 +19,31 @@ rules:
1919
resources:
2020
- deployments
2121
verbs:
22-
- "*"
22+
- "get"
23+
- "create"
24+
- "update"
25+
- "patch"
26+
- "delete"
2327
- apiGroups:
2428
- ""
2529
resources:
2630
- serviceaccounts
2731
- services
2832
verbs:
2933
- create
34+
- delete
35+
- update
36+
- patch
37+
- get
3038
---
3139
apiVersion: rbac.authorization.k8s.io/v1
3240
kind: ClusterRoleBinding
3341
metadata:
34-
name: openshift-minio-apply-tenants
42+
name: openshift-gitops-minio
3543
roleRef:
3644
apiGroup: rbac.authorization.k8s.io
3745
kind: ClusterRole
38-
name: openshift-minio-apply-tenants
46+
name: openshift-gitops-minio
3947
subjects:
4048
- kind: ServiceAccount
4149
name: openshift-gitops-argocd-application-controller

developer/openshift/gitops/argocd/pipeline-service-storage/minio/tenant/tenant.yaml

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: minio.min.io/v2
33
kind: Tenant
44
metadata:
5-
name: storage
5+
name: minio
66
namespace: tekton-results
77
labels:
88
app: minio
@@ -12,60 +12,35 @@ metadata:
1212
prometheus.io/scrape: "true"
1313
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
1414
spec:
15+
image: quay.io/minio/minio:latest
16+
requestAutoCert: false
17+
podManagementPolicy: Parallel
18+
configuration:
19+
name: minio-configuration
1520
exposeServices:
1621
minio: true
1722
features:
1823
bucketDNS: false
19-
domains: {}
20-
# This desired part doesn't work. Issues:
21-
# https://github.com/minio/operator/issues/1345
22-
# https://github.com/minio/operator/issues/1346
23-
# users:
24-
# - name: storage-user
25-
# buckets:
26-
# - name: "tekton-results"
27-
# region: "us-east-1"
28-
# objectLock: true
29-
certConfig: {}
30-
podManagementPolicy: Parallel
31-
configuration:
32-
name: minio-storage-configuration
33-
env: []
34-
serviceMetadata:
35-
minioServiceLabels: {}
36-
minioServiceAnnotations: {}
37-
consoleServiceLabels: {}
38-
consoleServiceAnnotations: {}
39-
priorityClassName: ""
40-
externalCaCertSecret: []
41-
externalCertSecret: []
42-
externalClientCertSecrets: []
43-
image: quay.io/minio/minio:RELEASE.2022-09-17T00-09-45Z
44-
imagePullSecret: {}
45-
mountPath: /export
46-
subPath: ""
24+
users:
25+
- name: minio-user
26+
buckets:
27+
- name: tekton-results
28+
region: not-applicable
29+
objectLock: true
4730
pools:
4831
- servers: 1
4932
name: pool-0
5033
volumesPerServer: 2
51-
nodeSelector: {}
52-
tolerations: []
53-
affinity:
54-
nodeAffinity: {}
55-
podAffinity: {}
56-
podAntiAffinity: {}
57-
resources: {}
5834
volumeClaimTemplate:
5935
apiVersion: v1
6036
kind: persistentvolumeclaims
61-
metadata: {}
6237
spec:
6338
accessModes:
6439
- ReadWriteOnce
6540
resources:
6641
requests:
6742
storage: 1Gi
68-
status: {}
69-
securityContext: {}
70-
containerSecurityContext: {}
71-
requestAutoCert: true
43+
securityContext:
44+
runAsNonRoot: true
45+
containerSecurityContext:
46+
runAsNonRoot: true

developer/openshift/gitops/argocd/pipeline-service-storage/postgres.yaml

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
image:
3+
tag: 13.10.0
4+
5+
tls:
6+
enabled: true
7+
autoGenerated: true
8+
9+
auth:
10+
database: tekton_results
11+
username: tekton
12+
existingSecret: tekton-results-database
13+
secretKeys:
14+
userPasswordKey: db.password
15+
adminPasswordKey: db.password
16+
17+
primary:
18+
resources:
19+
requests: null
20+
podSecurityContext:
21+
fsGroup: null
22+
seccompProfile:
23+
type: RuntimeDefault
24+
containerSecurityContext:
25+
allowPrivilegeEscalation: false
26+
runAsNonRoot: true
27+
runAsUser: null
28+
seccompProfile:
29+
type: RuntimeDefault
30+
capabilities:
31+
drop:
32+
- ALL
33+
34+
volumePermissions:
35+
enabled: false
36+
37+
shmVolume:
38+
enabled: false

developer/openshift/gitops/argocd/pipeline-service.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ metadata:
66
namespace: openshift-gitops
77
spec:
88
destination:
9-
namespace: openshift-gitops
9+
namespace: pipeline-service
1010
server: https://kubernetes.default.svc
11-
source:
12-
path: developer/openshift/gitops/argocd/pipeline-service
13-
repoURL: https://github.com/openshift-pipelines/pipeline-service.git
14-
targetRevision: main
11+
sources:
12+
- path: developer/openshift/gitops/argocd/pipeline-service
13+
repoURL: https://github.com/openshift-pipelines/pipeline-service.git
14+
targetRevision: main
1515
project: default
1616
syncPolicy:
1717
# Comment this out if you want to manually trigger deployments (using the

developer/openshift/gitops/argocd/pipeline-service/kustomization.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ kind: Kustomization
55
resources:
66
- ../../../../../operator/gitops/argocd/pipeline-service
77

8-
patches:
9-
- path: tekton-results/minio-create-bucket.yaml
10-
- path: tekton-results/minio-tls.yaml
8+
# Temporarily disabling the Minio TLS because the user creation with CSR is a bit flaky in the current version
9+
# patches:
10+
# - path: tekton-results/minio-tls.yaml
1111

1212
# Skip applying the Tekton operands while the Tekton operator is being installed.
1313
# See more information about this option, here:

0 commit comments

Comments
 (0)