-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add CI workflow and k8s deployment for otel
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
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,51 @@ | ||
name: Build and Publish Container image | ||
|
||
on: | ||
push: | ||
branches: [ otel ] | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build Container image | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: false | ||
|
||
push_to_registry: | ||
runs-on: ubuntu-latest | ||
name: Push container image to GitHub Packages | ||
needs: build | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ghcr.io/${{ github.repository_owner }}/image-name:${{ github.event.release.tag_name }} | ||
labels: | | ||
org.opencontainers.image.title=co-http | ||
org.opencontainers.image.description=Simple workload for testing performance and optimization | ||
org.opencontainers.image.url=github://github.com/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }} |
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,55 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
|
||
metadata: | ||
name: co-http | ||
labels: | ||
comp: co-http | ||
|
||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
comp: co-http | ||
template: | ||
metadata: | ||
labels: | ||
comp: co-http | ||
spec: | ||
containers: | ||
- name: main | ||
image: ghcr.io/opsani/co-http:0.7.0-otel | ||
args: [ 'busy=400' ] | ||
resources: | ||
limits: | ||
cpu: 250m | ||
memory: 256Mi | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
- name: OTEL_SERVICE_NAME | ||
value: "co-http" | ||
- name: OTEL_EXPORTER_OTLP_ENDPOINT | ||
value: "appdynamics-otel-collector-service.appdynamics.svc.cluster.local:4318" | ||
- name: OTEL_EXPORTER_OTLP_INSECURE | ||
value: "true" | ||
- name: OTEL_TRACES_EXPORTER | ||
value: "otlp,logging" | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
|
||
metadata: | ||
name: co-http | ||
|
||
spec: | ||
selector: | ||
comp: co-http | ||
ports: | ||
- protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 |