diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..a436fe4 --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -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 }} \ No newline at end of file diff --git a/k8s-otel/deployment.yaml b/k8s-otel/deployment.yaml new file mode 100644 index 0000000..7796d0e --- /dev/null +++ b/k8s-otel/deployment.yaml @@ -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