Skip to content

Commit

Permalink
remove stream simplify chart
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanrahic committed Sep 3, 2024
1 parent bf9baed commit 09fb1dc
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 113 deletions.
22 changes: 16 additions & 6 deletions helm-chart/readme.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
# Install Pokeshop with Helm

1. Execute `helm dependency update`
2. Execute `helm install -f ./values.yaml pokeshop .`
1. Update Helm dependencies

```bash
helm dependency update
```

2. Install the Helm chart

```bash
helm install -f ./values.yaml pokeshop .
```

3. [Get your Tracetest API key and env id](https://app.tracetest.io/retrieve-token)
4. Execute
4. Install Tracetest Agent

```bash
helm repo add tracetestcloud https://kubeshop.github.io/tracetest-cloud-charts --force-update && helm install agent tracetestcloud/tracetest-agent --set agent.apiKey=<TRACETEST_API_KEY> --set agent.environmentId=<TRACETEST_ENVIRONMENT_ID>
```

5. Create and run a test by going to [`app.tracetest.io`](https://app.tracetest.io) and using the internal Kubernetes service networking:

- **POST** `http://pokeshop-pokemon-api.default.svc.cluster.local:8081/pokemon/import` - Body: `{ "id": 1 }`
- **GET** `http://pokeshop-pokemon-api.default.svc.cluster.local:8081/pokemon`
- **POST** `http://pokeshop-pokemon-api:8081/pokemon/import` - Body: `{ "id": 1 }`
- **GET** `http://pokeshop-pokemon-api:8081/pokemon`

![](https://res.cloudinary.com/djwdcmwdz/image/upload/v1724764008/docs/app.tracetest.io_organizations_ttorg_e66318ba6544b856_environments_ttenv_4b0e8945dbe5045a_test_tTFZ453Ig_run_9_selectedSpan_bb8ba205b42a8619_nylqid.png)
![](https://res.cloudinary.com/djwdcmwdz/image/upload/v1725358889/docs/app.tracetest.io_organizations_ttorg_e66318ba6544b856_environments_ttenv_4b0e8945dbe5045a_test_Q6Mr5o3Ig_run_24_trigger_agj1ls.png)
23 changes: 5 additions & 18 deletions helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- $rpcPort := .Values.service.rpcPort -}}
{{- $httpPort := .Values.service.httpPort -}}
{{- $port := .Values.service.port -}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -36,7 +38,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
containerPort: {{ $httpPort }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
Expand Down Expand Up @@ -79,23 +81,8 @@ spec:
value: rpc
- name: SERVICE_NAME
value: pokeshop
{{- toYaml .Values.env | nindent 12 }}
- name: {{ .Chart.Name }}-stream-worker
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: NPM_RUN_COMMAND
value: stream-worker
- name: SERVICE_NAME
value: pokeshop-stream-worker
- name: RPC_PORT
value: "8082"
{{- toYaml .Values.env | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
4 changes: 4 additions & 0 deletions helm-chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 80
protocol: TCP
name: ingress
- port: {{ .Values.service.httpPort }}
targetPort: 8081
protocol: TCP
name: http
Expand Down
68 changes: 0 additions & 68 deletions helm-chart/templates/stream.deployment.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions helm-chart/templates/stream.service.yaml

This file was deleted.

12 changes: 11 additions & 1 deletion helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ securityContext:
service:
type: ClusterIP
port: 80
httpPort: 8081
rpcPort: 8082

ingress:
Expand Down Expand Up @@ -192,6 +193,11 @@ opentelemetry-collector:
tls:
insecure: true

otlp/tracetest:
endpoint: agent-tracetest-agent:4317
tls:
insecure: true

service:
pipelines:
logs:
Expand All @@ -202,10 +208,14 @@ opentelemetry-collector:
exporters: [debug/noop]
processors: [memory_limiter, batch]
receivers: [otlp,prometheus]
traces:
traces/jaeger:
receivers: [otlp]
processors: [batch]
exporters: [otlp/jaeger]
traces/tracetest:
receivers: [otlp]
processors: [batch]
exporters: [otlp/tracetest]

jaeger:
enabled: true
Expand Down

0 comments on commit 09fb1dc

Please sign in to comment.