Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into line-chart-widget
Browse files Browse the repository at this point in the history
# Conflicts:
#	exthttpcheck/fixAmount.go
#	exthttpcheck/periodically.go
#	go.mod
#	go.sum
  • Loading branch information
ReuDa committed Dec 11, 2024
2 parents e093337 + ecf3176 commit 54bf550
Show file tree
Hide file tree
Showing 26 changed files with 820 additions and 186 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v1.0.23

- Location selection for http checks (can be enabled via STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION env var, requires platform => 2.1.27)
- Use "error" in the expected HTTP status code field to verify that requests are returning an error
- Use uid instead of name for user statement in Dockerfile

## v1.0.22

- Update dependencies (go 1.23)
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##
## Build
##
FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.3.2 AS build
FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.4.8 AS build

ARG TARGETOS TARGETARCH
ARG BUILD_WITH_COVERAGE
Expand All @@ -22,7 +22,7 @@ RUN GOOS=$TARGETOS GOARCH=$TARGETARCH goreleaser build --snapshot="${BUILD_SNAPS
##
## Runtime
##
FROM alpine:3.20
FROM alpine:3.21

LABEL "steadybit.com.discovery-disabled"="true"

Expand All @@ -31,7 +31,7 @@ ARG USER_UID=10000

RUN adduser -u $USER_UID -D $USERNAME

USER $USERNAME
USER $USER_UID

WORKDIR /

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tidy:
.PHONY: audit
audit:
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-ST1000,-ST1003,-U1000 ./...
go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-SA1019,-ST1000,-ST1003,-U1000 ./...
go test -race -vet=off -coverprofile=coverage.out -timeout 30m ./...
go mod verify

Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Learn about the capabilities of this extension in our [Reliability Hub](https://

## Configuration

| Environment Variable | Helm value | Meaning | required | default |
|-------------------------------------------------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|
| `STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION` | `enableLocationSelection` | By default, the platform will select a random instance when executing actions from this extension. If you enable location selection, users can optionally specify the location via target selection. | no | false |

The extension supports all environment variables provided by [steadybit/extension-kit](https://github.com/steadybit/extension-kit#environment-variables).

## Installation
Expand Down Expand Up @@ -63,3 +67,19 @@ information about extension registration and how to verify.
## Proxy

A proxy configuration is currently not supported.

## Location Selection
When multiple HTTP extensions are deployed in different subsystems (e.g., multiple Kubernetes clusters), it can be tricky to ensure that the HTTP check is performed from the right location when testing cluster-internal URLs.
To solve this, you can activate the location selection feature.
Once you do that, the HTTP extension discovers itself as a client execution location.
When configuring the experiment, you can optionally define which extension's deployment should execute the HTTP check.
Also, the execution locations are part of Steadybit's environment concept, so you can assign permissions for execution locations.

### Migration Guideline
Before activating the location selection feature, be sure to follow these steps:
1. The installed agent version needs to be >= 2.0.47, and - only for on-prem customers - the platform version needs to be >=2.2.2
2. Activate the location selection via environment or helm variable when deploying the latest extension version (see [configuration options](#configuration).
3. Configure every environment that should be able to run HTTP checks by including the HTTP client location in the environment configuration.
One option is to add the statement `or target via the query language.type="com.steadybit.extension_http.client-location"` to your existing query.
You can also filter the available execution locations down, e.g., via the clustername by using `(target.type="com.steadybit.extension_http.client-location" and k8s.cluster-name="CLUSTER-NAME")`

4 changes: 2 additions & 2 deletions charts/steadybit-extension-http/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: steadybit-extension-http
description: Steadybit action implementation to check HTTP endpoints.
version: 1.1.10
appVersion: v1.0.22
version: 1.1.17
appVersion: v1.0.23
home: https://www.steadybit.com/
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png
maintainers:
Expand Down
31 changes: 23 additions & 8 deletions charts/steadybit-extension-http/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@ spec:
memory: {{ .Values.resources.limits.memory }}
cpu: {{ .Values.resources.limits.cpu }}
env:
{{ if .Values.enableLocationSelection }}
- name: STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION
value: "true"
{{- end }}
{{ if or (and .Values.global .Values.global.clusterName) .Values.kubernetes.clusterName }}
- name: STEADYBIT_EXTENSION_KUBERNETES_CLUSTER_NAME
value: {{ if and .Values.global .Values.global.clusterName }}{{ .Values.global.clusterName | quote }}{{ else }}{{ .Values.kubernetes.clusterName }}{{ end }}
{{- end }}
- name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "extensionlib.deployment.env" (list .) | nindent 12 }}
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
Expand Down Expand Up @@ -83,15 +103,10 @@ spec:
httpGet:
path: /health/readiness
port: 8081
{{- with .Values.containerSecurityContext }}
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10000
runAsGroup: 10000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
{{- include "extensionlib.deployment.volumes" (list .) | nindent 8 }}
serviceAccountName: {{ .Values.serviceAccount.name }}
Expand Down
2 changes: 1 addition & 1 deletion charts/steadybit-extension-http/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{- include "extensionlib.service" (list . 8085 (list "ACTION" )) -}}
{{- include "extensionlib.service" (list . 8085 (list "ACTION" "DISCOVERY" )) -}}
Loading

0 comments on commit 54bf550

Please sign in to comment.