Skip to content

Commit d0f8efd

Browse files
authored
Merge pull request #1656 from newrelic/mvick/add-metadata-action-step1
chore: Add metadata action - step 1
2 parents 8d62a84 + 49f0af4 commit d0f8efd

4 files changed

Lines changed: 233 additions & 0 deletions

File tree

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Copyright 2010 New Relic, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# 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
16+
namespace: newrelic
17+
name: com.newrelic.apm_python
18+
version: 0.1.0
19+
variables:
20+
k8s:
21+
podLabelSelector:
22+
description: "Pod label selector"
23+
type: yaml
24+
default: {}
25+
required: false
26+
containerSelector:
27+
description: "Container selector"
28+
type: yaml
29+
default: {}
30+
required: false
31+
namespaceLabelSelector:
32+
description: "Namespace label selector"
33+
type: yaml
34+
default: {}
35+
required: false
36+
# All 'agent' side-car related variables are flattened.
37+
version:
38+
description: "Python Agent init container version"
39+
type: string
40+
default: "latest"
41+
required: false
42+
env:
43+
description: "environment variables to pass to Python agent"
44+
type: yaml
45+
default: []
46+
required: false
47+
imagePullPolicy:
48+
description: "image pull policy for the Python agent init container"
49+
type: string
50+
default: "Always"
51+
required: false
52+
resourceRequirements:
53+
description: "resource requirements for the Python agent init container"
54+
type: yaml
55+
default: {}
56+
required: false
57+
securityContext:
58+
description: "security context for the Python agent init container"
59+
type: yaml
60+
default: {}
61+
required: false
62+
# All health sidecar related variables are flattened and prefixed with "health_"
63+
health_env:
64+
description: "environment variables to pass to health sidecar"
65+
type: yaml
66+
default: []
67+
required: false
68+
health_version:
69+
description: "health sidecar image version"
70+
type: string
71+
default: "latest"
72+
required: false
73+
health_imagePullPolicy:
74+
description: "image pull policy for the health sidecar"
75+
type: string
76+
default: "Always"
77+
required: false
78+
health_resourceRequirements:
79+
description: "resource requirements for the health sidecar"
80+
type: yaml
81+
default: {}
82+
required: false
83+
health_securityContext:
84+
description: "security context for the health sidecar"
85+
type: yaml
86+
default: {}
87+
required: false
88+
deployment:
89+
k8s:
90+
health:
91+
interval: 30s
92+
initial_delay: 30s
93+
objects:
94+
instrumentation:
95+
apiVersion: newrelic.com/v1beta3
96+
kind: Instrumentation
97+
metadata:
98+
name: ${nr-sub:agent_id}
99+
# APM CRs should be installed in "nr-ac:namespace"
100+
# Due to a limitation in the k8s-agents-operator, Instrumentation CRs must be installed in the same namespace as the operator.
101+
# Hence, the namespace is set to "nr-ac:namespace_agents".
102+
# Reference: https://github.com/newrelic/k8s-agents-operator/blob/92c19208864f051f03f457ee04b772fca5042162/api/v1beta1/instrumentation_webhook.go#L110C27-L110C72
103+
namespace: ${nr-ac:namespace_agents}
104+
spec:
105+
agent:
106+
language: python
107+
image: newrelic/newrelic-python-init:${nr-var:version}
108+
env: ${nr-var:env}
109+
imagePullPolicy: ${nr-var:imagePullPolicy}
110+
resources: ${nr-var:resourceRequirements}
111+
securityContext: ${nr-var:securityContext}
112+
healthAgent:
113+
image: newrelic/k8s-apm-agent-health-sidecar:${nr-var:health_version}
114+
env: ${nr-var:health_env}
115+
imagePullPolicy: ${nr-var:health_imagePullPolicy}
116+
resources: ${nr-var:health_resourceRequirements}
117+
securityContext: ${nr-var:health_securityContext}
118+
podLabelSelector: ${nr-var:podLabelSelector}
119+
namespaceLabelSelector: ${nr-var:namespaceLabelSelector}
120+
containerSelector: ${nr-var:containerSelector}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2010 New Relic, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
agentControlDefinitions:
16+
- platform: KUBERNETESCLUSTER
17+
supportFromAgent: 1.0.0
18+
supportFromAgentControl: 1.0.0
19+
content: ./agentControl/agent-schema-for-agent-control.yml
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2010 New Relic, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
configurationDefinitions:
16+
- platform: KUBERNETESCLUSTER
17+
description: Python agent configuration
18+
type: agent-config
19+
version: 1.0.0
20+
# will add schema information here later
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright 2010 New Relic, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Agent Metadata
16+
17+
permissions:
18+
contents: read
19+
20+
on:
21+
# Allows manual triggering with parameters
22+
workflow_dispatch:
23+
inputs:
24+
version:
25+
description: "Version tag (needs to exactly match the GH tag for the release)"
26+
required: true
27+
type: string
28+
agent-type:
29+
description: "Agent type"
30+
required: false
31+
default: "NRPythonAgent"
32+
type: string
33+
use-cache:
34+
description: "Use cache"
35+
required: false
36+
default: true
37+
type: boolean
38+
39+
# Allows calling from another workflow
40+
workflow_call:
41+
inputs:
42+
version:
43+
description: "Version tag (needs to exactly match the GH tag for the release)"
44+
required: true
45+
type: string
46+
agent-type:
47+
description: "Agent type"
48+
required: false
49+
default: "NRPythonAgent"
50+
type: string
51+
use-cache:
52+
description: "Use cache"
53+
required: false
54+
default: true
55+
type: boolean
56+
secrets:
57+
FC_SYS_ID_CLIENT_ID:
58+
required: true
59+
FC_SYS_ID_PR_KEY:
60+
required: true
61+
APM_CONTROL_NR_LICENSE_KEY_STAGING:
62+
required: false
63+
64+
jobs:
65+
send-agent-metadata:
66+
uses: newrelic/newrelic-agent-init-container/.github/workflows/agent-metadata.yml@main
67+
with:
68+
agent-type: ${{ inputs.agent-type }}
69+
version: ${{ inputs.version }}
70+
use-cache: ${{ inputs.use-cache }}
71+
secrets:
72+
FC_SYS_ID_CLIENT_ID: ${{ secrets.FC_SYS_ID_CLIENT_ID }}
73+
FC_SYS_ID_PR_KEY: ${{ secrets.FC_SYS_ID_PR_KEY }}
74+
APM_CONTROL_NR_LICENSE_KEY_STAGING: ${{ secrets.APM_CONTROL_NR_LICENSE_KEY_STAGING }} # action app is instrumented and supported by APM Control team

0 commit comments

Comments
 (0)