This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-showcase.git
The following commit(s) were added to refs/heads/main by this push:
new 0255011 Add alias for Charts that contains - (#122)
0255011 is described below
commit 0255011c1ae6125e4504556332e81d9c17726d9c
Author: kezhenxu94 <[email protected]>
AuthorDate: Thu Apr 13 10:26:53 2023 +0800
Add alias for Charts that contains - (#122)
---
deploy/platform/kubernetes/Chart.yaml | 2 ++
deploy/platform/kubernetes/Makefile | 26 +++++++++++-----------
deploy/platform/kubernetes/templates/NOTES.txt | 20 ++++++++---------
deploy/platform/kubernetes/templates/_helpers.tpl | 12 +++++-----
.../templates/feature-event/resources.yaml | 2 +-
deploy/platform/kubernetes/values.yaml | 4 ++--
6 files changed, 34 insertions(+), 32 deletions(-)
diff --git a/deploy/platform/kubernetes/Chart.yaml
b/deploy/platform/kubernetes/Chart.yaml
index 3a8e4e8..a525e16 100644
--- a/deploy/platform/kubernetes/Chart.yaml
+++ b/deploy/platform/kubernetes/Chart.yaml
@@ -23,11 +23,13 @@ sources:
- https://github.com/apache/skywalking-showcase
dependencies:
- name: skywalking-helm
+ alias: skywalking
version: 0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9
repository: oci://ghcr.io/apache/skywalking-kubernetes
# @feature: java-agent-injector; the java agent injector is a component of
the swck operator, so we need to deploy the swck operator firstly
- name: skywalking-helm-swck-operator
+ alias: swck
version: 0.0.0-8c143d7203ef3ed0e067646390609d0db06a2cc9
repository: oci://ghcr.io/apache/skywalking-kubernetes
condition: features.javaAgentInjector.enabled
diff --git a/deploy/platform/kubernetes/Makefile
b/deploy/platform/kubernetes/Makefile
index 6ff7eb0..06b7a27 100644
--- a/deploy/platform/kubernetes/Makefile
+++ b/deploy/platform/kubernetes/Makefile
@@ -19,12 +19,12 @@
include ../../../Makefile.in
include Makefile.in
-HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.fullnameOverride=$(RELEASE)
-HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.oap.image.repository=$(SW_OAP_IMAGE) --set
skywalking-helm.oap.image.tag=$(SW_OAP_IMAGE_TAG)
-HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.ui.image.repository=$(SW_UI_IMAGE) --set
skywalking-helm.ui.image.tag=$(SW_UI_IMAGE_TAG)
-HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.ui.env.SW_ZIPKIN_ADDRESS=http://$(RELEASE)-oap.$(NAMESPACE).svc:9412
-HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.satellite.image.repository=$(SW_SATELLITE_IMAGE) --set
skywalking-helm.satellite.image.tag=$(SW_SATELLITE_IMAGE_TAG)
-HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm-swck-operator.image.repository=$(SWCK_OPERATOR_IMAGE) --set
skywalking-helm-swck-operator.image.tag=$(SWCK_OPERATOR_IMAGE_TAG)
+HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking.fullnameOverride=$(RELEASE)
+HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking.oap.image.repository=$(SW_OAP_IMAGE) --set
skywalking.oap.image.tag=$(SW_OAP_IMAGE_TAG)
+HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking.ui.image.repository=$(SW_UI_IMAGE) --set
skywalking.ui.image.tag=$(SW_UI_IMAGE_TAG)
+HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking.ui.env.SW_ZIPKIN_ADDRESS=http://$(RELEASE)-oap.$(NAMESPACE).svc:9412
+HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking.satellite.image.repository=$(SW_SATELLITE_IMAGE) --set
skywalking.satellite.image.tag=$(SW_SATELLITE_IMAGE_TAG)
+HELM_OPTIONS := $(HELM_OPTIONS) --set
swck.image.repository=$(SWCK_OPERATOR_IMAGE) --set
swck.image.tag=$(SWCK_OPERATOR_IMAGE_TAG)
HELM_OPTIONS := $(HELM_OPTIONS) --set sampleServices.hub=$(HUB) --set
sampleServices.tag=$(TAG) --set
sampleServices.namespace=$(SAMPLE_SERVICES_NAMESPACE)
HELM_OPTIONS := $(HELM_OPTIONS) --set
opentelemetry-collector.image.repository=$(OTEL_COLLECTOR_IMAGE) --set
opentelemetry-collector.image.tag=$(OTEL_COLLECTOR_IMAGE_TAG)
HELM_OPTIONS := $(HELM_OPTIONS) --set
features.rover.swctl.image=$(SW_CLI_IMAGE)
@@ -58,21 +58,21 @@ feature-java-agent-injector:
.PHONY: feature-single-node
feature-single-node:
- $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.oap.replicas=1)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking.oap.replicas=1)
.PHONY: feature-cluster
feature-cluster:
- $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.oap.replicas=2)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set skywalking.oap.replicas=2)
.PHONY: feature-elasticsearch
feature-elasticsearch:
- $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.oap.storageType=elasticsearch)
- $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.elasticsearch.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking.oap.storageType=elasticsearch)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking.elasticsearch.enabled=true)
.PHONY: feature-postgresql
feature-postgresql:
- $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.oap.storageType=postgresql)
- $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking-helm.postgresql.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking.oap.storageType=postgresql)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
skywalking.postgresql.enabled=true)
.PHONY: feature-so11y
feature-so11y:
@@ -156,7 +156,7 @@ deploy: $(features)
helm dep up .
helm -n $(NAMESPACE) upgrade --install $(RELEASE) . --create-namespace
--timeout=20m $(HELM_OPTIONS)
- $(info rollout restart to allow the new sidecar to be injected.)
+ $(shell echo rollout restart to allow the new sidecar to be injected.)
kubectl -n $(SAMPLE_SERVICES_NAMESPACE) get deployments -o name | xargs
kubectl -n $(SAMPLE_SERVICES_NAMESPACE) rollout restart
.PHONY: undeploy
diff --git a/deploy/platform/kubernetes/templates/NOTES.txt
b/deploy/platform/kubernetes/templates/NOTES.txt
index bbed9c2..8b35be5 100644
--- a/deploy/platform/kubernetes/templates/NOTES.txt
+++ b/deploy/platform/kubernetes/templates/NOTES.txt
@@ -26,26 +26,26 @@ Thank you for installing {{ .Chart.Name }}.
Your release is named {{ .Release.Name }}.
Get the UI URL by running these commands:
-{{- if index .Values "skywalking-helm" "ui" "ingress" "enabled" }}
-{{- range index .Values "skywalking-helm" "ui" "ingress" "hosts" }}
- http{{ if index $.Values "ui" "ingress" "tls" }}s{{ end }}://{{ . }}{{ index
$.Values "ui" "ingress" "path" }}
+{{- if .Values.skywalking.ui.ingress.enabled }}
+{{- range .Values.skywalking.ui.ingress.hosts }}
+ http{{ if $.Values.skywalking.ui.ingress.tls }}s{{ end }}://{{ . }}{{
$.Values.skywalking.ui.ingress.path }}
{{- end }}
-{{- else if contains "NodePort" (index .Values "skywalking-helm" "ui"
"service" "type") }}
+{{- else if contains "NodePort" .Values.skywalking.ui.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o
jsonpath="{.spec.ports[0].nodePort}" services {{ include
"skywalking.ui.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" (index .Values "skywalking-helm" "ui"
"service" "type") }}
+{{- else if contains "LoadBalancer" .Values.skywalking.ui.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 svc -w {{
include "skywalking.ui.fullname" . }} -n {{ .Release.Namespace }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{
include "skywalking.ui.fullname" . }} -o
jsonpath='{.status.loadBalancer.ingress[0].ip}')
- echo http://$SERVICE_IP:{{ index .Values "skywalking-helm" "ui" "service"
"externalPort" }}
-{{- else if contains "ClusterIP" (index .Values "skywalking-helm" "ui"
"service" "type") }}
+ echo http://$SERVICE_IP:{{ .Values.skywalking.ui.service.externalPort }}
+{{- else if contains "ClusterIP" .Values.skywalking.ui.service.type }}
echo "Visit http://127.0.0.1:8080 to use your application"
- kubectl port-forward svc/{{ printf "%s-ui" .Release.Name }} 8080:{{ index
.Values "skywalking-helm" "ui" "service" "externalPort" }} --namespace {{
.Release.Namespace }}
+ kubectl port-forward svc/{{ printf "%s-ui" .Release.Name }} 8080:{{
.Values.skywalking.ui.service.externalPort }} --namespace {{ .Release.Namespace
}}
{{- end }}
-{{- if index .Values "skywalking-helm" "elasticsearch" "enabled" }}
-{{- if index .Values "skywalking-helm" "elasticsearch" "persistence" "enabled"
}}
+{{- if .Values.skywalking.elasticsearch.enabled }}
+{{- if .Values.skywalking.elasticsearch.persistence.enabled }}
{{- else }}
#################################################################################
###### WARNING: Persistence is disabled!!! You will lose your data when
#####
diff --git a/deploy/platform/kubernetes/templates/_helpers.tpl
b/deploy/platform/kubernetes/templates/_helpers.tpl
index 71044fa..b05fa54 100644
--- a/deploy/platform/kubernetes/templates/_helpers.tpl
+++ b/deploy/platform/kubernetes/templates/_helpers.tpl
@@ -19,21 +19,21 @@ limitations under the License.
The collector address, might be OAP or Satellite
*/}}
{{- define "skywalking.collector.address" -}}
-{{- if index .Values "skywalking-helm" "satellite" "enabled" }}
-{{- printf "%s-satellite.%s.svc.cluster.local:%d" (index .Values
"skywalking-helm" "fullnameOverride") .Release.Namespace 11800 }}
+{{- if .Values.skywalking.satellite.enabled }}
+{{- printf "%s-satellite.%s.svc.cluster.local:%d"
.Values.skywalking.fullnameOverride .Release.Namespace 11800 }}
{{- else }}
-{{- printf "%s-oap.%s.svc.cluster.local:%d" (index .Values "skywalking-helm"
"fullnameOverride") .Release.Namespace 11800 }}
+{{- printf "%s-oap.%s.svc.cluster.local:%d"
.Values.skywalking.fullnameOverride .Release.Namespace 11800 }}
{{- end -}}
{{- end -}}
{{- define "skywalking.oap.address.host" -}}
-{{- printf "%s-oap.%s.svc.cluster.local" (index .Values "skywalking-helm"
"fullnameOverride") .Release.Namespace }}
+{{- printf "%s-oap.%s.svc.cluster.local" .Values.skywalking.fullnameOverride
.Release.Namespace }}
{{- end -}}
{{- define "skywalking.oap.address.grpc" -}}
-{{- printf "%s-oap.%s.svc.cluster.local:%d" (index .Values "skywalking-helm"
"fullnameOverride") .Release.Namespace 11800 }}
+{{- printf "%s-oap.%s.svc.cluster.local:%d"
.Values.skywalking.fullnameOverride .Release.Namespace 11800 }}
{{- end -}}
{{- define "skywalking.oap.address.http" -}}
-{{- printf "http://%s-oap.%s.svc.cluster.local:%d" (index .Values
"skywalking-helm" "fullnameOverride") .Release.Namespace 12800 }}
+{{- printf "http://%s-oap.%s.svc.cluster.local:%d"
.Values.skywalking.fullnameOverride .Release.Namespace 12800 }}
{{- end -}}
diff --git a/deploy/platform/kubernetes/templates/feature-event/resources.yaml
b/deploy/platform/kubernetes/templates/feature-event/resources.yaml
index 8c87b64..d3ff047 100644
--- a/deploy/platform/kubernetes/templates/feature-event/resources.yaml
+++ b/deploy/platform/kubernetes/templates/feature-event/resources.yaml
@@ -37,7 +37,7 @@ data:
serviceInstance: "{{"{{"}} .Pod.Name {{"}}"}}"
endpoint: ""
message: "{{"{{"}} .Event.Message {{"}}"}}"
- address: "{{ .Release.Name }}-skywalking-helm:11800"
+ address: "{{ .Release.Name }}-oap:11800"
---
apiVersion: apps/v1
diff --git a/deploy/platform/kubernetes/values.yaml
b/deploy/platform/kubernetes/values.yaml
index 2f30a73..31d45d5 100644
--- a/deploy/platform/kubernetes/values.yaml
+++ b/deploy/platform/kubernetes/values.yaml
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-skywalking-helm:
+skywalking:
fullnameOverride: "sw-demo"
oap:
name: oap
@@ -141,7 +141,7 @@ sampleServices:
namespace: sample-services
# @feature: java-agent-injector; the java agent injector is a component of the
swck operator, so we need to deploy the swck operator firstly
-skywalking-helm-swck-operator:
+swck:
image:
repository: ~
tag: ~