-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98790f4
commit a8c92a7
Showing
6 changed files
with
137 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
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
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,79 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: workitems | ||
namespace: weekplanner | ||
labels: | ||
app: workitems | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: workitems | ||
template: | ||
metadata: | ||
annotations: | ||
metrics.dynatrace.com/path: /stats/prometheus | ||
metrics.dynatrace.com/port: "15020" | ||
metrics.dynatrace.com/scrape: "true" | ||
metrics.dynatrace.com/secure: "false" | ||
namespace: weekplanner | ||
labels: | ||
app: workitems | ||
app.kubernetes.io/version: 1.2.0 | ||
app.kubernetes.io/part-of: WeekPlanner | ||
spec: | ||
containers: | ||
- name: workitems | ||
image: ghcr.io/ihudak/weekplanner-workitems:latest | ||
ports: | ||
- containerPort: 8080 | ||
- containerPort: 5005 | ||
envFrom: | ||
- configMapRef: | ||
name: weekplanner-configmap | ||
- secretRef: | ||
name: weekplanner-secret | ||
env: | ||
- name: DT_RELEASE_VERSION | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.labels['app.kubernetes.io/version'] | ||
- name: DT_RELEASE_BUILD_VERSION | ||
value: "2024-04-08-21:40:50" | ||
- name: SERVICE_NAME | ||
value: WorkItems | ||
- name: SERVICE_FULL_NAME | ||
value: "$(APP_NAME).$(SERVICE_NAME).$(SVC_SUFFIX)" | ||
- name: OTEL_RESOURCE_ATTRIBUTES | ||
value: "dt.security_context=$(SECURITY_CONTEXT),dt.cost.costcenter=$(COST_CENTER),dt.cost.project=$(COST_PRODUCT),my.resource.attribute=$(MY_ATTR)" | ||
- name: TENANT_URL | ||
value: "https://$(TENANT_ID).$(TENANT_LAYER).$(DT_SRV).com" | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 768Mi | ||
requests: | ||
cpu: 500m | ||
memory: 512Mi | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: workitems-svc | ||
namespace: weekplanner | ||
spec: | ||
selector: | ||
app: workitems | ||
type: ClusterIP # LoadBalancer | ||
ports: | ||
- name: http | ||
port: 84 | ||
protocol: TCP | ||
targetPort: 8080 | ||
# nodePort: 30008 # comment if ClusterIP | ||
- name: debug | ||
port: 5008 | ||
protocol: TCP | ||
targetPort: 5005 | ||
# nodePort: 32008 # comment if ClusterIP |
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,22 @@ | ||
FROM ubuntu:jammy | ||
LABEL org.opencontainers.image.authors="dec21.eu" | ||
|
||
ENV EXECUTABLE=workitems | ||
|
||
RUN mkdir -p /opt/app | ||
WORKDIR /opt/app | ||
COPY build/native/nativeCompile/ . | ||
RUN chmod +x "$EXECUTABLE" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl sed && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENTRYPOINT export TENANT_URL=$(echo "$TENANT_URL" | sed -E 's/[ '\$'/'']+\$//') && \ | ||
export TENANT_TOKEN=$(curl -X GET "$TENANT_URL"/api/v1/deployment/installer/agent/connectioninfo \ | ||
-H "accept: application/json" \ | ||
-H "Authorization: Api-Token $OA_TOKEN" | \ | ||
grep tenantToken | \ | ||
sed s/\ \ \"tenantToken\"\ :\ \"// | sed s/\",//) && \ | ||
export DT_AGENT_OPTIONS=tenant=$TENANT_ID,tenantToken=$TENANT_TOKEN,server="$TENANT_URL:443" && \ | ||
"./$EXECUTABLE" |
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,14 @@ | ||
FROM openjdk:22 | ||
MAINTAINER dynatrace.com | ||
RUN mkdir -p /opt/app | ||
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 | ||
ENV DOCKER_VER=1.5.0 | ||
|
||
ARG JAR_FILE=build/libs/*0.0.1-SNAPSHOT.jar | ||
COPY ${JAR_FILE} /opt/app/app.jar | ||
|
||
ENTRYPOINT export OTEL_SERVICE_NAME="$SERVICE_FULL_NAME" && \ | ||
java -Dotel.service.name=$SERVICE_FULL_NAME -jar /opt/app/app.jar | ||
|
||
EXPOSE 8080 | ||
EXPOSE 5005 |
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,2 @@ | ||
docker image build --platform linux/amd64 -t ivangudak096/weekplanner-workitems:latest . | ||
docker push ivangudak096/weekplanner-workitems:latest |