diff --git a/.fleetControl/agentControl/agent-schema-for-agent-control.yml b/.fleetControl/agentControl/agent-schema-for-agent-control.yml new file mode 100644 index 000000000..32f7b26dc --- /dev/null +++ b/.fleetControl/agentControl/agent-schema-for-agent-control.yml @@ -0,0 +1,106 @@ +# 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 +namespace: newrelic +name: com.newrelic.apm_python +version: 0.1.0 +variables: + k8s: + podLabelSelector: + description: "Pod label selector" + type: yaml + default: { } + required: false + containerSelector: + description: "Container selector" + type: yaml + default: { } + required: false + namespaceLabelSelector: + description: "Namespace label selector" + type: yaml + default: { } + required: false + # All 'agent' side-car related variables are flattened. + version: + description: "Python Agent init container version" + type: string + default: "latest" + required: false + env: + description: "environment variables to pass to Python agent" + type: yaml + default: [ ] + required: false + imagePullPolicy: + description: "image pull policy for the Python agent init container" + type: string + default: "Always" + required: false + resourceRequirements: + description: "resource requirements for the Python agent init container" + type: yaml + default: { } + required: false + securityContext: + description: "security context for the Python agent init container" + type: yaml + default: { } + required: false + # All health sidecar related variables are flattened and prefixed with "health_" + health_env: + description: "environment variables to pass to health sidecar" + type: yaml + default: [ ] + required: false + health_version: + description: "health sidecar image version" + type: string + default: "latest" + required: false + health_imagePullPolicy: + description: "image pull policy for the health sidecar" + type: string + default: "Always" + required: false + health_resourceRequirements: + description: "resource requirements for the health sidecar" + type: yaml + default: { } + required: false + health_securityContext: + description: "security context for the health sidecar" + type: yaml + default: { } + required: false +deployment: + k8s: + health: + interval: 30s + initial_delay: 30s + objects: + instrumentation: + apiVersion: newrelic.com/v1beta3 + kind: Instrumentation + metadata: + name: ${nr-sub:agent_id} + # APM CRs should be installed in "nr-ac:namespace" + # Due to a limitation in the k8s-agents-operator, Instrumentation CRs must be installed in the same namespace as the operator. + # Hence, the namespace is set to "nr-ac:namespace_agents". + # Reference: https://github.com/newrelic/k8s-agents-operator/blob/92c19208864f051f03f457ee04b772fca5042162/api/v1beta1/instrumentation_webhook.go#L110C27-L110C72 + namespace: ${nr-ac:namespace_agents} + spec: + agent: + language: python + image: newrelic/newrelic-python-init:${nr-var:version} + env: ${nr-var:env} + imagePullPolicy: ${nr-var:imagePullPolicy} + resources: ${nr-var:resourceRequirements} + securityContext: ${nr-var:securityContext} + healthAgent: + image: newrelic/k8s-apm-agent-health-sidecar:${nr-var:health_version} + env: ${nr-var:health_env} + imagePullPolicy: ${nr-var:health_imagePullPolicy} + resources: ${nr-var:health_resourceRequirements} + securityContext: ${nr-var:health_securityContext} + podLabelSelector: ${nr-var:podLabelSelector} + namespaceLabelSelector: ${nr-var:namespaceLabelSelector} + containerSelector: ${nr-var:containerSelector} diff --git a/.fleetControl/agentControlDefinitions.yml b/.fleetControl/agentControlDefinitions.yml new file mode 100644 index 000000000..6948e255e --- /dev/null +++ b/.fleetControl/agentControlDefinitions.yml @@ -0,0 +1,5 @@ +agentControlDefinitions: + - platform: KUBERNETESCLUSTER + supportFromAgent: 1.0.0 + supportFromAgentControl: 1.0.0 + content: ./agentControl/agent-schema-for-agent-control.yml diff --git a/.fleetControl/configurationDefinitions.yml b/.fleetControl/configurationDefinitions.yml new file mode 100644 index 000000000..8ff9b36c7 --- /dev/null +++ b/.fleetControl/configurationDefinitions.yml @@ -0,0 +1,6 @@ +configurationDefinitions: + - platform: KUBERNETESCLUSTER + description: Python agent configuration + type: agent-config + version: 1.0.0 +# will add schema information here later diff --git a/.github/workflows/agent-metadata.yml b/.github/workflows/agent-metadata.yml new file mode 100644 index 000000000..a62b3d67e --- /dev/null +++ b/.github/workflows/agent-metadata.yml @@ -0,0 +1,57 @@ +name: Agent Metadata + +permissions: + contents: read + +on: + # Allows manual triggering with parameters + workflow_dispatch: + inputs: + version: + description: 'Version tag (needs to exactly match the GH tag for the release)' + required: true + type: string + agent-type: + description: 'Agent type' + required: false + default: 'NRPythonAgent' + type: string + use-cache: + description: 'Use cache' + required: false + default: true + type: boolean + + # Allows calling from another workflow + workflow_call: + inputs: + version: + description: 'Version tag (needs to exactly match the GH tag for the release)' + required: true + type: string + agent-type: + description: 'Agent type' + required: false + default: 'NRPythonAgent' + type: string + use-cache: + description: 'Use cache' + required: false + default: true + type: boolean + secrets: + FC_SYS_ID_CLIENT_ID: + required: true + FC_SYS_ID_PR_KEY: + required: true + +jobs: + send-agent-metadata: + uses: newrelic/newrelic-agent-init-container/.github/workflows/agent-metadata.yml@main + with: + agent-type: ${{ inputs.agent-type }} + version: ${{ inputs.version }} + use-cache: ${{ inputs.use-cache }} + secrets: + FC_SYS_ID_CLIENT_ID: ${{ secrets.FC_SYS_ID_CLIENT_ID }} + FC_SYS_ID_PR_KEY: ${{ secrets.FC_SYS_ID_PR_KEY }}