Skip to content

Commit

Permalink
Feat: optimize labels to solve serviceMonitor's mismatching with serv…
Browse files Browse the repository at this point in the history
…ice (#7)

* Feat: optimize labels to solve serviceMonitor's mismatching with service && fix tekton-resources's misused git script && bump horizon's version to v2.0.4

---------

Co-authored-by: yeka <[email protected]>
  • Loading branch information
iamyeka authored Feb 16, 2023
1 parent 0773a6b commit e0aa23e
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 24 deletions.
4 changes: 2 additions & 2 deletions charts/horizon/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: A CICD DevOps Platform

type: application

version: 2.0.2
appVersion: v2.0.2
version: 2.0.3
appVersion: v2.0.4

dependencies:
- name: gitlab
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: horizon-build
annotations:
"helm.sh/hook": "post-install,post-upgrade"
spec:
params:
- name: token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: horizon-deploy
annotations:
"helm.sh/hook": "post-install,post-upgrade"
spec:
params:
- name: token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: horizon-pipeline
annotations:
"helm.sh/hook": "post-install,post-upgrade"
spec:
params:
- name: token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerBinding
metadata:
name: horizon-taskbinding
annotations:
"helm.sh/hook": "post-install,post-upgrade"
spec:
params:
- name: token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: triggers.tekton.dev/v1alpha1
kind: EventListener
metadata:
name: horizon-listener
annotations:
"helm.sh/hook": "post-install,post-upgrade"
spec:
serviceAccountName: tekton-triggers-sa
replicas: {{ .Values.eventListener.replicas }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
name: horizon-triggertemplate
annotations:
"helm.sh/hook": "post-install,post-upgrade"
spec:
params:
- name: token
Expand Down Expand Up @@ -49,8 +47,6 @@ spec:
kind: PipelineRun
metadata:
name: $(tt.params.cluster)-$(tt.params.pipelinerunID)
annotations:
"helm.sh/hook": "post-install,post-upgrade"
spec:
pipelineRef:
name: horizon-pipeline
Expand Down
8 changes: 5 additions & 3 deletions charts/horizon/charts/tektonci-resources/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
horizon:
buildTask:
buildTask:
image:
gitStep: horizoncd/kaniko-bash:v0.0.2
compileStep: horizoncd/kaniko-bash:v0.0.2
Expand Down Expand Up @@ -34,7 +34,9 @@ horizon:
# config git ssh
rm -rf /root/.ssh && ln -s /tekton/home/.ssh /root
echo -e 'Host *\n StrictHostKeyChecking no' >> /root/.ssh/config
if [ -f "/root/.ssh/config" ]; then
echo -e 'Host *\n StrictHostKeyChecking no' >> /root/.ssh/config
fi
# check https url and match token
retrieve_pull_url() {
Expand Down Expand Up @@ -326,4 +328,4 @@ gitRepos:
http: []
eventListener:
replicas: 1
extraVolumeMounts: []
extraVolumeMounts: []
2 changes: 2 additions & 0 deletions charts/horizon/templates/core/core-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
name: {{ template "horizon.core" . }}
labels:
{{ include "horizon.labels" . | indent 4 }}
component: core
spec:
endpoints:
- interval: 30s
Expand All @@ -13,6 +14,7 @@ spec:
selector:
matchLabels:
{{ include "horizon.labels" . | indent 6 }}
component: core
{{- end}}


1 change: 1 addition & 0 deletions charts/horizon/templates/core/core-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ template "horizon.core" . }}
labels:
{{ include "horizon.labels" . | indent 4 }}
component: core
spec:
ports:
- name: http
Expand Down
1 change: 1 addition & 0 deletions charts/horizon/templates/swagger/swagger-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ template "horizon.swagger" . }}
labels:
{{ include "horizon.labels" . | indent 4 }}
component: swagger
spec:
ports:
- name: http
Expand Down
10 changes: 5 additions & 5 deletions charts/horizon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ core:
additionalLabels: {}
image:
repository: horizoncd/horizon-core
tag: v2.0.2
tag: v2.0.4
args:
loglevel:
gitOpsRepoDefaultBranch: master
Expand Down Expand Up @@ -2062,7 +2062,7 @@ job:
additionalLabels: {}
image:
repository: horizoncd/horizon-job
tag: v2.0.2
tag: v2.0.4
args:
loglevel:
gitOpsRepoDefaultBranch: master
Expand All @@ -2080,7 +2080,7 @@ swagger:
replicas: 1
image:
repository: horizoncd/horizon-swagger
tag: v2.0.2
tag: v2.0.4
securityContext:
runAsUser: 10001
fsGroup: 10001
Expand All @@ -2096,7 +2096,7 @@ web:
replicas: 1
image:
repository: horizoncd/horizon-web
tag: v2.0.2
tag: v2.0.3
securityContext:
runAsUser: 10001
fsGroup: 10001
Expand Down Expand Up @@ -3205,7 +3205,7 @@ tektoncd:
default-cloud-events-sink: http://horizon-core-cloudevent.horizoncd/apis/internal/cloudevents
tektonDashboard:
ingress:
host: tekton.h8s.site
host: tekton.h8r.site

harbor:
enabled: true
Expand Down

0 comments on commit e0aa23e

Please sign in to comment.