Skip to content

Commit 070f62f

Browse files
committed
chore: Add metadata action - step 1
1 parent 80f4a3c commit 070f62f

File tree

4 files changed

+174
-0
lines changed

4 files changed

+174
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# original source: https://github.com/newrelic/newrelic-agent-control/blob/main/agent-control/agent-type-registry/newrelic/com.newrelic.apm_python-0.1.0.yaml
2+
namespace: newrelic
3+
name: com.newrelic.apm_python
4+
version: 0.1.0
5+
variables:
6+
k8s:
7+
podLabelSelector:
8+
description: "Pod label selector"
9+
type: yaml
10+
default: { }
11+
required: false
12+
containerSelector:
13+
description: "Container selector"
14+
type: yaml
15+
default: { }
16+
required: false
17+
namespaceLabelSelector:
18+
description: "Namespace label selector"
19+
type: yaml
20+
default: { }
21+
required: false
22+
# All 'agent' side-car related variables are flattened.
23+
version:
24+
description: "Python Agent init container version"
25+
type: string
26+
default: "latest"
27+
required: false
28+
env:
29+
description: "environment variables to pass to Python agent"
30+
type: yaml
31+
default: [ ]
32+
required: false
33+
imagePullPolicy:
34+
description: "image pull policy for the Python agent init container"
35+
type: string
36+
default: "Always"
37+
required: false
38+
resourceRequirements:
39+
description: "resource requirements for the Python agent init container"
40+
type: yaml
41+
default: { }
42+
required: false
43+
securityContext:
44+
description: "security context for the Python agent init container"
45+
type: yaml
46+
default: { }
47+
required: false
48+
# All health sidecar related variables are flattened and prefixed with "health_"
49+
health_env:
50+
description: "environment variables to pass to health sidecar"
51+
type: yaml
52+
default: [ ]
53+
required: false
54+
health_version:
55+
description: "health sidecar image version"
56+
type: string
57+
default: "latest"
58+
required: false
59+
health_imagePullPolicy:
60+
description: "image pull policy for the health sidecar"
61+
type: string
62+
default: "Always"
63+
required: false
64+
health_resourceRequirements:
65+
description: "resource requirements for the health sidecar"
66+
type: yaml
67+
default: { }
68+
required: false
69+
health_securityContext:
70+
description: "security context for the health sidecar"
71+
type: yaml
72+
default: { }
73+
required: false
74+
deployment:
75+
k8s:
76+
health:
77+
interval: 30s
78+
initial_delay: 30s
79+
objects:
80+
instrumentation:
81+
apiVersion: newrelic.com/v1beta3
82+
kind: Instrumentation
83+
metadata:
84+
name: ${nr-sub:agent_id}
85+
# APM CRs should be installed in "nr-ac:namespace"
86+
# Due to a limitation in the k8s-agents-operator, Instrumentation CRs must be installed in the same namespace as the operator.
87+
# Hence, the namespace is set to "nr-ac:namespace_agents".
88+
# Reference: https://github.com/newrelic/k8s-agents-operator/blob/92c19208864f051f03f457ee04b772fca5042162/api/v1beta1/instrumentation_webhook.go#L110C27-L110C72
89+
namespace: ${nr-ac:namespace_agents}
90+
spec:
91+
agent:
92+
language: python
93+
image: newrelic/newrelic-python-init:${nr-var:version}
94+
env: ${nr-var:env}
95+
imagePullPolicy: ${nr-var:imagePullPolicy}
96+
resources: ${nr-var:resourceRequirements}
97+
securityContext: ${nr-var:securityContext}
98+
healthAgent:
99+
image: newrelic/k8s-apm-agent-health-sidecar:${nr-var:health_version}
100+
env: ${nr-var:health_env}
101+
imagePullPolicy: ${nr-var:health_imagePullPolicy}
102+
resources: ${nr-var:health_resourceRequirements}
103+
securityContext: ${nr-var:health_securityContext}
104+
podLabelSelector: ${nr-var:podLabelSelector}
105+
namespaceLabelSelector: ${nr-var:namespaceLabelSelector}
106+
containerSelector: ${nr-var:containerSelector}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
agentControlDefinitions:
2+
- platform: KUBERNETESCLUSTER
3+
supportFromAgent: 1.0.0
4+
supportFromAgentControl: 1.0.0
5+
content: ./agentControl/agent-schema-for-agent-control.yml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
configurationDefinitions:
2+
- platform: KUBERNETESCLUSTER
3+
description: Python agent configuration
4+
type: agent-config
5+
version: 1.0.0
6+
# will add schema information here later
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Agent Metadata
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
# Allows manual triggering with parameters
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
description: 'Version tag (needs to exactly match the GH tag for the release)'
12+
required: true
13+
type: string
14+
agent-type:
15+
description: 'Agent type'
16+
required: false
17+
default: 'NRPythonAgent'
18+
type: string
19+
use-cache:
20+
description: 'Use cache'
21+
required: false
22+
default: true
23+
type: boolean
24+
25+
# Allows calling from another workflow
26+
workflow_call:
27+
inputs:
28+
version:
29+
description: 'Version tag (needs to exactly match the GH tag for the release)'
30+
required: true
31+
type: string
32+
agent-type:
33+
description: 'Agent type'
34+
required: false
35+
default: 'NRPythonAgent'
36+
type: string
37+
use-cache:
38+
description: 'Use cache'
39+
required: false
40+
default: true
41+
type: boolean
42+
secrets:
43+
FC_SYS_ID_CLIENT_ID:
44+
required: true
45+
FC_SYS_ID_PR_KEY:
46+
required: true
47+
48+
jobs:
49+
send-agent-metadata:
50+
uses: newrelic/newrelic-agent-init-container/.github/workflows/agent-metadata.yml@main
51+
with:
52+
agent-type: ${{ inputs.agent-type }}
53+
version: ${{ inputs.version }}
54+
use-cache: ${{ inputs.use-cache }}
55+
secrets:
56+
FC_SYS_ID_CLIENT_ID: ${{ secrets.FC_SYS_ID_CLIENT_ID }}
57+
FC_SYS_ID_PR_KEY: ${{ secrets.FC_SYS_ID_PR_KEY }}

0 commit comments

Comments
 (0)