-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Xueliang Yang <[email protected]>
- Loading branch information
Showing
5 changed files
with
270 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Supported workload type | ||
Pyroscope Trait supports following component types: webservice、worker and cloneset. | ||
|
||
# How to start | ||
- Use a component typed webservice to start, keep the following to app-demo.yaml, then vela up -f app-demo.yaml | ||
```shell | ||
apiVersion: core.oam.dev/v1beta1 | ||
kind: Application | ||
metadata: | ||
name: app-show | ||
namespace: real-new-ns | ||
spec: | ||
components: | ||
- name: web-show | ||
type: webservice | ||
properties: | ||
exposeType: ClusterIP | ||
image: beellzrocks/shippingservice | ||
env: | ||
- name: PORT | ||
value: "50051" | ||
- name: APPLICATION_NAME # Application name shown in the Pyroscope UI | ||
value: "web-show" | ||
- name: SERVER_ADDRESS # To change Pyroscope Server Port change the value, the naming rule is pyroscope-<component name> | ||
value: "http://pyroscope-web-show:4040" | ||
traits: | ||
- type: pyroscope | ||
``` | ||
- Check the app status | ||
```shell | ||
vela ls -n real-new-ns | ||
APP COMPONENT TYPE TRAITS PHASE HEALTHY STATUS CREATED-TIME | ||
app-show web-show webservice pyroscope running healthy Ready:1/1 2022-06-03 19:41:05 +0800 CST | ||
|
||
vela status app-show -n real-new-ns | ||
About: | ||
|
||
Name: app-show | ||
Namespace: real-new-ns | ||
Created at: 2022-06-03 19:41:05 +0800 CST | ||
Status: running | ||
|
||
Workflow: | ||
|
||
mode: DAG | ||
finished: true | ||
Suspend: false | ||
Terminated: false | ||
Steps | ||
- id:zsbjvp7fg5 | ||
name:web-show | ||
type:apply-component | ||
phase:succeeded | ||
message: | ||
|
||
Services: | ||
|
||
- Name: web-show | ||
Cluster: local Namespace: real-new-ns | ||
Type: webservice | ||
Healthy Ready:1/1 | ||
Traits: | ||
? pyroscope | ||
``` | ||
|
||
- Use the port-forward to visit the pyroscope UI | ||
```shell | ||
vela port-forward app-show 8080:4040 -n real-new-ns | ||
? You have 3 deployed resources in your app. Please choose one: Cluster: local | Namespace: real-new-ns | Kind: Service | Name: pyroscope-web-show | ||
Forwarding from 127.0.0.1:8080 -> 4040 | ||
Forwarding from [::1]:8080 -> 4040 | ||
|
||
Forward successfully! Opening browser ... | ||
|
||
Failed to open browser: exec: "xdg-open": executable file not found in $PATHHandling connection for 8080 | ||
Handling connection for 8080 | ||
|
||
Then you can visit the http://<your ip>:8080 in the browser | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
pyroscope: { | ||
annotations: {} | ||
attributes: { | ||
appliesToWorkloads: ["webservice","worker","cloneset"] | ||
conflictsWith: [] | ||
podDisruptive: false | ||
workloadRefPath: "" | ||
} | ||
description: "" | ||
labels: {} | ||
type: "trait" | ||
} | ||
|
||
template: { | ||
outputs: | ||
"pyroscope-deployment":{ | ||
metadata: { | ||
name: "pyroscope-"+context.name | ||
labels: { | ||
"app.kubernetes.io/instance": "pyroscope-"+context.name | ||
"app.kubernetes.io/name": "pyroscope-"+context.name | ||
"app.kubernetes.io/version": "0.17.1" | ||
} | ||
namespace: context.namespace | ||
} | ||
spec: { | ||
progressDeadlineSeconds: 600 | ||
replicas: 1 | ||
revisionHistoryLimit: 10 | ||
selector: matchLabels: { | ||
"app.kubernetes.io/instance": "pyroscope-"+context.name | ||
"app.kubernetes.io/name": "pyroscope-"+context.name | ||
} | ||
strategy: type: "Recreate" | ||
template: { | ||
metadata: { | ||
labels: { | ||
"app.kubernetes.io/instance": "pyroscope-"+context.name | ||
"app.kubernetes.io/name": "pyroscope-"+context.name | ||
} | ||
creationTimestamp: null | ||
} | ||
spec: { | ||
securityContext: fsGroup: 101 | ||
containers: [{ | ||
name: "pyroscope-"+context.name | ||
args: ["server", "-config", "/tmp/config.yaml"] | ||
image: "pyroscope/pyroscope:0.17.1" | ||
imagePullPolicy: "IfNotPresent" | ||
livenessProbe: { | ||
failureThreshold: 3 | ||
httpGet: { | ||
path: "/healthz" | ||
port: 4040 | ||
scheme: "HTTP" | ||
} | ||
initialDelaySeconds: 30 | ||
periodSeconds: 15 | ||
successThreshold: 1 | ||
timeoutSeconds: 30 | ||
} | ||
ports: [{ | ||
name: "api" | ||
containerPort: 4040 | ||
protocol: "TCP" | ||
}] | ||
readinessProbe: { | ||
failureThreshold: 3 | ||
httpGet: { | ||
path: "/healthz" | ||
port: 4040 | ||
scheme: "HTTP" | ||
} | ||
initialDelaySeconds: 30 | ||
periodSeconds: 5 | ||
successThreshold: 1 | ||
timeoutSeconds: 30 | ||
} | ||
resources: {} | ||
securityContext: {} | ||
terminationMessagePath: "/dev/termination-log" | ||
terminationMessagePolicy: "File" | ||
volumeMounts: [{ | ||
name: "config" | ||
mountPath: "/tmp/config.yaml" | ||
subPath: "config.yaml" | ||
}] | ||
}] | ||
dnsPolicy: "ClusterFirst" | ||
restartPolicy: "Always" | ||
schedulerName: "default-scheduler" | ||
serviceAccount: "pyroscope-"+context.name | ||
serviceAccountName: "pyroscope-"+context.name | ||
terminationGracePeriodSeconds: 30 | ||
volumes: [{ | ||
name: "config" | ||
configMap: { | ||
name: "pyroscope-"+context.name | ||
defaultMode: 420 | ||
} | ||
}] | ||
} | ||
} | ||
} | ||
apiVersion: "apps/v1" | ||
kind: "Deployment" | ||
} | ||
outputs: | ||
"pyroscope-cm":{ | ||
apiVersion: "v1" | ||
data: "config.yaml": """ | ||
{} | ||
""" | ||
kind: "ConfigMap" | ||
metadata: { | ||
name: "pyroscope-"+context.name | ||
labels: { | ||
"app.kubernetes.io/instance": "pyroscope-"+context.name | ||
"app.kubernetes.io/name": "pyroscope-"+context.name | ||
} | ||
namespace: context.namespace | ||
} | ||
} | ||
outputs: | ||
"pyroscope-svc":{ | ||
apiVersion: "v1" | ||
kind: "Service" | ||
metadata: { | ||
name: "pyroscope-"+context.name | ||
labels: { | ||
"app.kubernetes.io/instance": "pyroscope-"+context.name | ||
"app.kubernetes.io/name": "pyroscope-"+context.name | ||
} | ||
namespace: context.namespace | ||
} | ||
spec: { | ||
ports: [{ | ||
name: "http" | ||
port: 4040 | ||
protocol: "TCP" | ||
targetPort: "api" | ||
}] | ||
selector: { | ||
"app.kubernetes.io/instance": "pyroscope-"+context.name | ||
"app.kubernetes.io/name": "pyroscope-"+context.name | ||
} | ||
sessionAffinity: "None" | ||
type: "ClusterIP" | ||
} | ||
} | ||
|
||
outputs: | ||
"pyroscope-sa": { | ||
apiVersion: "v1" | ||
kind: "ServiceAccount" | ||
metadata: { | ||
name: "pyroscope-"+context.name | ||
labels: { | ||
"app.kubernetes.io/instance": "pyroscope-"+context.name | ||
"app.kubernetes.io/name": "pyroscope-"+context.name | ||
} | ||
namespace: context.namespace | ||
} | ||
} | ||
parameter: {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: pyroscope | ||
version: v0.17.1 | ||
description: "Continuous Profiling Platform. Debug performance issues down to a single line of code" | ||
icon: "https://user-images.githubusercontent.com/662636/105129037-11334180-5a99-11eb-8951-1d4aaaed50de.png" | ||
url: "https://github.com/pyroscope-io/pyroscope" | ||
|
||
tags: | ||
- extended_trait | ||
|
||
deployTo: | ||
control_plane: true | ||
|
||
invisible: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
parameter: { | ||
"replicacount": *1 | int | ||
"enabled": *true | bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters