Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions .build/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
apiVersion: builds.katanomi.dev/v1alpha1
kind: Build
spec:
runTemplate:
spec:
timeouts:
pipeline: 1h
workspaces:
- name: source
volumeClaimTemplate:
spec:
storageClassName: topolvm
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
- name: cache
persistentVolumeClaim:
claimName: build-cache
subPath: yarn_cache
tasks:
- name: generate-custom-version
workspaces:
- name: source
workspace: source
params:
- name: pr-id
value: $(build.git.pullRequest.id)
- name: commit-short-id
value: $(build.git.lastCommit.shortID)
taskSpec:
params:
- name: pr-id
value: ""
- name: commit-short-id
value: ""
results:
- name: custom-version
description: image tag
default: latest
description: generate image tag
workspaces:
- name: source
workspace: source
steps:
- image: registry.alauda.cn:60080/devops/kubectl-devops:master
name: generate-custom-version
imagePullPolicy: IfNotPresent
workingDir: $(workspaces.source.path)
script: |
#!/bin/sh
set -ex
if [ "$(params.pr-id)" == "" ]; then
echo -n date-$(date +%s)-$(params.commit-short-id) > $(results.custom-version.path)
else
echo -n pr-$(params.commit-short-id) > $(results.custom-version.path)
fi
- name: build-docs
retries: 2
workspaces:
- name: source
workspace: source
- name: cache
workspace: cache
taskSpec:
steps:
- image: build-harbor.alauda.cn/frontend/playwright-runner:doom
imagePullPolicy: Always
name: install
resources:
limits:
cpu: 4
memory: 4Gi
requests:
cpu: 2
memory: 4Gi
script: >
# set -x

export COREPACK_NPM_REGISTRY=https://edge-nexus.alauda.cn/repository/cnpm

export YARN_GLOBAL_FOLDER=/workspace/yarn_cache/global

yarn config set npmRegistryServer https://edge-nexus.alauda.cn/repository/cnpm

yarn set version stable

yarn up @alauda/doom

yarn up -R '**'

yarn --immutable

yarn build
workingDir: $(workspaces.source.path)
- name: build-image
timeout: 30m
runAfter:
- build-docs
- generate-custom-version
retries: 0
taskRef:
kind: ClusterTask
name: alauda-build-image
workspaces:
- name: source
workspace: source
params:
- name: container-image
value: build-harbor.alauda.cn/middleware/knowledge
- name: dockerfile
value: ./Dockerfile
- name: labels
value:
- branch=$(build.git.branch.name)
- commit=$(build.git.lastCommit.id)
- name: container-image-tag
value: $(tasks.generate-custom-version.results.custom-version)
98 changes: 98 additions & 0 deletions .build/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: knowledge-docs
spec:
selector:
matchLabels:
service_name: alauda-product-docs
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
service_name: alauda-product-docs
spec:
containers:
- args:
- --log-level=info
- --log-disable-color
- --log-enable-caller
- --path-prefix=/knowledge/
- --assets-host-path=$(SHARED_FOLDER)
env:
- name: SHARED_FOLDER
value: /static
image: registry.alauda.cn:60080/alauda/alauda-console:v3.18.5
imagePullPolicy: IfNotPresent
name: alauda-console
ports:
- containerPort: 8080
protocol: TCP
resources:
limits:
cpu: "2"
memory: 4Gi
requests:
cpu: 25m
memory: 128Mi
volumeMounts:
- mountPath: /static
name: shared
dnsPolicy: ClusterFirst
initContainers:
- command:
- sh
- /config/copy_static.sh
env:
- name: SHARED_FOLDER
value: /static
- name: STATIC_FILES
value: /dist
image: registry.alauda.cn:60080/middleware/knowledge:date-1750994389-5d78d699
imagePullPolicy: IfNotPresent
name: product-docs
volumeMounts:
- mountPath: /static
name: shared
- mountPath: /config
name: copy-static-script
restartPolicy: Always
schedulerName: default-scheduler
volumes:
- emptyDir: {}
name: shared
- configMap:
defaultMode: 420
name: knowledge-docs-copy-script
name: copy-static-script
---
apiVersion: v1
kind: Service
metadata:
name: knowledge-docs
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
service_name: alauda-product-docs
type: NodePort

---
apiVersion: v1
kind: ConfigMap
metadata:
name: knowledge-docs-copy-script
data:
copy_static.sh: |-
SHARED_FOLDER="${SHARED_FOLDER:-/shared}"
STATIC_FILES="${STATIC_FILES:-/files}"
env
cp -prv $STATIC_FILES/* $SHARED_FOLDER
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM build-harbor.alauda.cn/ops/alpine:3

RUN mkdir -p /dist/

COPY dist/ /dist/
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,19 @@ Assuming the ACP platform URL is *https://43.138.134.22*, and DeepFlow is instal

Visit the Grafana URL in your browser, and you will see a login page:

![Login Page](./assets-deepflow/login.png)
![Login Page](../assets/deepflow/login.png)

You can login to Grafana with the username and password specified in step 5. **We strongly recommend that you change Grafana's default password.**

### DeepFlow Dashboards

In the Grafana web UI, enter the **Dashboards** menu:

![Dashboards](./assets-deepflow/dashboards.png)
![Dashboards](../assets/deepflow/dashboards.png)

Enter the DeepFlow Templates folder, and you will see available dashboards:

![Dashboards Folder](./assets-deepflow/dashboards-folder.png)
![Dashboards Folder](../assets/deepflow/dashboards-folder.png)

### Troubleshooting with DeepFlow

Expand All @@ -288,21 +288,21 @@ Here are two example about how to troubleshoot DNS failure and chained HTTP requ

If your application is facing DNS failures, you can open the **Distributed Tracing** dashboard:

![Distributed Tracing](./assets-deepflow/distributed-tracing.png)
![Distributed Tracing](../assets/deepflow/distributed-tracing.png)

In the variable selections, choose namespace and workload of your application, and then input domain name; In the time settings, choose the time span you need.

Here is an example:

![](./assets-deepflow/dns-options.png)
![](../assets/deepflow/dns-options.png)

Click the **Refresh** button, and you can view DNS requests in the **Request List** panel:

![DNS Request List](./assets-deepflow/dns-request-list.png)
![DNS Request List](../assets/deepflow/dns-request-list.png)

The DNS request domain and status are also available:

![DNS Request Status](./assets-deepflow/dns-status.png)
![DNS Request Status](../assets/deepflow/dns-status.png)

> *Client Error* means the requested domain does not exist.

Expand All @@ -312,11 +312,11 @@ Assuming the are two HTTP GET requests chained with HTTP header *X-Request-ID*:

In the **Distributed Tracing** dashboard, you can see the request logs:

![Request Logs](./assets-deepflow/http.png)
![Request Logs](../assets/deepflow/http.png)

Click the request log, and you can see a flame graph in the **DeepFlow Flame Graph** panel:

![Flame Graph](./assets-deepflow/flame-graph.png)
![Flame Graph](../assets/deepflow/flame-graph.png)

> "S" means the request is captured on the system process side, and "N" means captured on network nic side.

Expand All @@ -327,4 +327,4 @@ The flame graph shows that:

Click a span in the flame graph, you can see some more details, including start time, end time and status code:

![Details](./assets-deepflow/flame-graph-details.png)
![Details](../assets/deepflow/flame-graph-details.png)
Original file line number Diff line number Diff line change
Expand Up @@ -950,10 +950,10 @@ This triggers Flagger to start the canary analysis process.
You can monitor the progress of the canary deployment through:

1. Alauda Service Mesh UI to monitor metrics
![alauda mesh ui](./assets/canary.png "canary deploy")
![alauda mesh ui](../../assets/canary.png "canary deploy")

2. The demo UI
![demo ui](./assets/demo-gw.png "demo")
![demo ui](../../assets/demo-gw.png "demo")

3. Watching VirtualService changes

Expand All @@ -972,7 +972,7 @@ You can monitor the progress of the canary deployment through:
7. Complete traffic migration
8. Scale down canary deployment

![flagger step](./assets/flagger-step.png "rollback button")
![flagger step](../../assets/flagger-step.png "rollback button")

#### Step 5: Promotion and rollback options

Expand Down Expand Up @@ -1011,10 +1011,10 @@ kubectl label ${CANARY_EVENT} action=rollback -n flagger-demo
*UI Method:*

1. View event history
![event history](./assets/eventhistory.png "event history")
![event history](../../assets/eventhistory.png "event history")

2. Review specific events
![event detail](./assets/eventdetail.png "event detail")
![event detail](../../assets/eventdetail.png "event detail")

*CLI Method:*

Expand Down