|
46 | 46 | fail-fast: false |
47 | 47 | matrix: |
48 | 48 | k8s_version: |
49 | | - - 'v1.17.2' |
50 | 49 | - 'v1.20.15' |
51 | 50 | - 'v1.22.2' |
| 51 | + - 'v1.24.3' |
52 | 52 | image_type: |
53 | 53 | - "buster" |
54 | 54 | - "alpine" |
@@ -148,9 +148,9 @@ jobs: |
148 | 148 | fail-fast: false |
149 | 149 | matrix: |
150 | 150 | k8s_version: |
151 | | - - 'v1.16.4' |
152 | 151 | - 'v1.17.2' |
153 | 152 | - 'v1.22.2' |
| 153 | + - 'v1.24.3' |
154 | 154 | image_type: |
155 | 155 | - "buster" |
156 | 156 | - "alpine" |
@@ -209,3 +209,115 @@ jobs: |
209 | 209 | status: ${{ job.status }} |
210 | 210 | steps: ${{ toJson(steps) }} |
211 | 211 | channel: '#cloud-tech' |
| 212 | + |
| 213 | + daemonset_controller_type_k8s_explorer: |
| 214 | + name: Daemonset (Explorer) - k8s ${{ matrix.k8s_version }} - ${{ matrix.image_type }} |
| 215 | + runs-on: ubuntu-latest |
| 216 | + |
| 217 | + needs: pre_job |
| 218 | + # NOTE: We always want to run job on main branch |
| 219 | + if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/main' }} |
| 220 | + |
| 221 | + strategy: |
| 222 | + fail-fast: false |
| 223 | + matrix: |
| 224 | + k8s_version: |
| 225 | + - 'v1.22.2' |
| 226 | + - 'v1.24.3' |
| 227 | + image_type: |
| 228 | + - "buster" |
| 229 | + - "alpine" |
| 230 | + |
| 231 | + steps: |
| 232 | + - name: Checkout Repository |
| 233 | + uses: actions/checkout@v2 |
| 234 | + with: |
| 235 | + fetch-depth: 0 |
| 236 | + |
| 237 | + - name: Set up Chart Testing Environment and Kubernetes Cluster |
| 238 | + uses: ./.github/actions/setup-chart-testing-environment/ |
| 239 | + with: |
| 240 | + k8s_version: "${{ matrix.k8s_version }}" |
| 241 | + github_token: "${{ secrets.GITHUB_TOKEN }}" |
| 242 | + |
| 243 | + - name: Install Scalyr tool |
| 244 | + run: | |
| 245 | + curl https://raw.githubusercontent.com/scalyr/scalyr-tool/master/scalyr > scalyr |
| 246 | + chmod +x scalyr |
| 247 | + sudo mv scalyr /usr/local/bin |
| 248 | +
|
| 249 | + - name: Install Helm Chart |
| 250 | + uses: ./.github/actions/install-helm-chart |
| 251 | + with: |
| 252 | + scalyr_api_key: "${{ secrets.SCALYR_WRITE_API_KEY_US }}" |
| 253 | + values_file_path: "ci/daemonset-agent-values-with-k8s-explorer.yaml" |
| 254 | + image_type: "${{ matrix.image_type }}" |
| 255 | + |
| 256 | + # Create mock pods and exporters which will be scrapped by the monitor |
| 257 | + # (step taken from scalyr-agent-2 repo) |
| 258 | + - name: Create mock pods and exporters |
| 259 | + run: | |
| 260 | + git clone --depth 1 https://github.com/scalyr/scalyr-agent-2.git |
| 261 | +
|
| 262 | + kubectl create namespace monitoring |
| 263 | +
|
| 264 | + # 1. node exporter pod |
| 265 | + pushd scalyr-agent-2/ |
| 266 | + kubectl apply -f tests/e2e/k8s_om_monitor/node_exporter.yaml |
| 267 | +
|
| 268 | + # 2. kube state metrics deployment |
| 269 | + kubectl apply -k tests/e2e/k8s_om_monitor/kube-state-metrics/ |
| 270 | +
|
| 271 | + # 3. Install dummy java app container with jmx exporter side |
| 272 | + kubectl apply -f tests/e2e/k8s_om_monitor/java_app_deployment.yaml |
| 273 | + popd |
| 274 | +
|
| 275 | + sleep 20 |
| 276 | + kubectl get pods -A |
| 277 | +
|
| 278 | + - name: Verify Agent Logs are Ingested |
| 279 | + env: |
| 280 | + scalyr_readlog_token: "${{ secrets.SCALYR_READ_API_KEY_US }}" |
| 281 | + SCALYR_AGENT_POD_NAME: "${{ env.SCALYR_AGENT_POD_NAME }}" |
| 282 | + run: | |
| 283 | + # Verify agent and kubernetes monitor has been started |
| 284 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "Starting scalyr agent..."' |
| 285 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "No checkpoints were found. All logs will be copied starting at their current end"' |
| 286 | +
|
| 287 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "Cluster name detected, enabling k8s metric reporting"' |
| 288 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "kubernetes_monitor parameters: "' |
| 289 | +
|
| 290 | + #./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "Config option '\'stop_agent_on_failure\'' is enabled"' |
| 291 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "stop_agent_on_failure"' |
| 292 | +
|
| 293 | + # Verify Kubernetes metrics are beeing ingested |
| 294 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/kubernetes_monitor.log" "k8s-daemon-set=\"scalyr-agent\""' |
| 295 | +
|
| 296 | + # Verify Kubernetes Explorer logs are there - note: logs won't be complete since atm we |
| 297 | + # don't install kube state + node exporter metrics exporter |
| 298 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "monitor:openmetrics_monitor"' |
| 299 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "Starting monitor openmetrics_monitor"' |
| 300 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent_debug.log" "Adding new monitor with config:"' |
| 301 | +
|
| 302 | + # Assert that Kubernetes Explorer metrics which we scrape from 2 annotated pods are there |
| 303 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" logfile contains "node-exporter" k8s-cluster="k8s-explorer-e2e-tests" k8s-daemon-set="node-exporter" "level=info collector=cpu"' |
| 304 | +
|
| 305 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" monitor="openmetrics_monitor" logfile contains "kubernetes-api-cadvisor-metrics.log" k8s-cluster="k8s-explorer-e2e-tests"' |
| 306 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" monitor="openmetrics_monitor" logfile contains "kubernetes-api-cadvisor-metrics.log" k8s-cluster="k8s-explorer-e2e-tests" "container_start_time_seconds "' |
| 307 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" monitor="openmetrics_monitor" logfile contains "kubernetes-api-cadvisor-metrics.log" k8s-cluster="k8s-explorer-e2e-tests" "container_spec_memory_limit_bytes "' |
| 308 | +
|
| 309 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" monitor="openmetrics_monitor" logfile contains "node-exporter" k8s-cluster="k8s-explorer-e2e-tests"' |
| 310 | + ./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" monitor="openmetrics_monitor" logfile contains "node-exporter" k8s-cluster="k8s-explorer-e2e-tests" "process_resident_memory_bytes"' |
| 311 | +
|
| 312 | + - name: Notify Slack on Failure |
| 313 | + # NOTE: github.ref is set to pr ref (and not branch name, e.g. refs/pull/28/merge) for pull |
| 314 | + # requests and that's why we need this special conditional and check for github.head_ref in |
| 315 | + # case of PRs |
| 316 | + if: ${{ failure() && (github.ref == 'refs/heads/main' || github.head_ref == 'main') }} |
| 317 | + uses: act10ns/slack@e4e71685b9b239384b0f676a63c32367f59c2522 # v1.2.2 |
| 318 | + env: |
| 319 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 320 | + with: |
| 321 | + status: ${{ job.status }} |
| 322 | + steps: ${{ toJson(steps) }} |
| 323 | + channel: '#cloud-tech' |
0 commit comments