From 645b57180d4030c57617473a69127a7178096fc5 Mon Sep 17 00:00:00 2001 From: wuhuizuo Date: Tue, 8 Oct 2024 21:06:06 +0800 Subject: [PATCH] build(tiup-publisher): fix image repo and chart (#175) Signed-off-by: wuhuizuo Signed-off-by: wuhuizuo --- charts/tiup-publisher/templates/NOTES.txt | 23 +------------------ .../tiup-publisher/templates/deployment.yaml | 8 +++---- .../templates/tests/test-connection.yaml | 15 ------------ charts/tiup-publisher/values.yaml | 3 ++- tiup-publisher/skaffold.yaml | 2 +- 5 files changed, 8 insertions(+), 43 deletions(-) delete mode 100644 charts/tiup-publisher/templates/tests/test-connection.yaml diff --git a/charts/tiup-publisher/templates/NOTES.txt b/charts/tiup-publisher/templates/NOTES.txt index 07630f5..142cf66 100644 --- a/charts/tiup-publisher/templates/NOTES.txt +++ b/charts/tiup-publisher/templates/NOTES.txt @@ -1,22 +1 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "tiup-publisher.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "tiup-publisher.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "tiup-publisher.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "tiup-publisher.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} +It is a consumer worker, no public serivce. diff --git a/charts/tiup-publisher/templates/deployment.yaml b/charts/tiup-publisher/templates/deployment.yaml index e29d4d2..375cdef 100644 --- a/charts/tiup-publisher/templates/deployment.yaml +++ b/charts/tiup-publisher/templates/deployment.yaml @@ -35,11 +35,11 @@ spec: securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + {{- with .Values.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: {{ .Values.service.port }} - protocol: TCP livenessProbe: httpGet: path: / diff --git a/charts/tiup-publisher/templates/tests/test-connection.yaml b/charts/tiup-publisher/templates/tests/test-connection.yaml deleted file mode 100644 index b682e42..0000000 --- a/charts/tiup-publisher/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "tiup-publisher.fullname" . }}-test-connection" - labels: - {{- include "tiup-publisher.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "tiup-publisher.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/charts/tiup-publisher/values.yaml b/charts/tiup-publisher/values.yaml index 213f847..97368f5 100644 --- a/charts/tiup-publisher/values.yaml +++ b/charts/tiup-publisher/values.yaml @@ -3,7 +3,8 @@ # Declare variables to be passed into your templates. replicaCount: 1 - +args: [] + # - --config=/etc/config/config.yaml image: repository: ghcr.io/pingcap-qe/ee-apps/tiup-publisher pullPolicy: IfNotPresent diff --git a/tiup-publisher/skaffold.yaml b/tiup-publisher/skaffold.yaml index e501014..bdb8308 100644 --- a/tiup-publisher/skaffold.yaml +++ b/tiup-publisher/skaffold.yaml @@ -5,7 +5,7 @@ metadata: build: platforms: ["linux/amd64", "linux/arm64"] artifacts: - - image: dl + - image: tiup-publisher docker: dockerfile: Dockerfile local: