Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2023 05 16.1.fa26250 #1037

Merged
merged 40 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
260aa6c
ROX-16546 - Add Central Fleet-Manager CLI commands (#961)
SimonBaeumer Apr 26, 2023
70c099e
Error message fix, take 100 (#988)
SimonBaeumer Apr 26, 2023
7034c3a
ROX-15981: add force reconcile flag to central requests (#972)
johannes94 Apr 27, 2023
1583286
update prod observability operator to v4.2.1 (#985)
stehessel Apr 27, 2023
091e9a2
ROX-15941: Run multiple operators from FSS (#951)
kurlov Apr 28, 2023
ed1800b
ROX-15980 probe resource requests and limits (#992)
ludydoo May 2, 2023
8620c55
ROX-15980 observability resource requests and limits (#993)
ludydoo May 2, 2023
1d2003e
ROX-15980: Set resources requests and limits for fleetshard-sync (#990)
ludydoo May 2, 2023
4add821
ROX-16769 add resources for observability operator (#995)
ludydoo May 2, 2023
aad51d1
ROX-15980 set resource requests and limits to the egress-proxy (#991)
ludydoo May 3, 2023
357a23f
fix e2e admin tests by reducing required resources (#1007)
johannes94 May 3, 2023
fc0f2be
Add `sleep(6s)` before tracking central creation (#999)
parametalol May 3, 2023
06e11f6
ROX-13692: create final snapshot for tenant db (#994)
johannes94 May 4, 2023
e5e9b24
Revert "ROX-13692: create final snapshot for tenant db (#994)" (#1009)
johannes94 May 4, 2023
a54fabb
Bump github.com/aws/aws-sdk-go from 1.44.248 to 1.44.255 (#1008)
dependabot[bot] May 4, 2023
2d638c1
Bump github.com/aws/aws-sdk-go from 1.44.255 to 1.44.256 (#1011)
dependabot[bot] May 4, 2023
d16053f
ROX-15954: Setup non-admin access to observability resources (#1006)
ivan-degtiarenko May 4, 2023
b27ede3
ROX-16791: Increase route timeout to 10m to allow for longer operatio…
connorgorman May 4, 2023
beaf7c9
ROX-16894: Enable CloudWatch log exports for new RDS DBs (#1013)
vladbologa May 4, 2023
61b65b7
ROX-16883: Increase resource limits to avoid throttling (#723)
connorgorman May 4, 2023
3439058
Upgrade go version to 1.20 (#1005)
kovayur May 5, 2023
d73873b
ROX-16338: Refactor helm chart installation (#954)
kurlov May 5, 2023
233a502
Remove acs-stage-eu-01 from Helm bootstrapping CI (#1014)
ebensh May 8, 2023
00ea528
Add admin API client (#998)
SimonBaeumer May 8, 2023
5c60dfd
ROX-13692: fix final snapshot creation (#1012)
johannes94 May 9, 2023
c66a19a
Bump github.com/prometheus/client_golang from 1.14.0 to 1.15.1 (#1016)
dependabot[bot] May 9, 2023
7f5db4d
Bump github.com/onsi/ginkgo/v2 from 2.9.2 to 2.9.4 in /tools (#1015)
dependabot[bot] May 9, 2023
8498a12
Bump github.com/openshift-online/ocm-sdk-go from 0.1.331 to 0.1.339 (…
dependabot[bot] May 9, 2023
03bfdb6
ROX-13692: skip final snapshots for probe (#1018)
johannes94 May 10, 2023
fe9a497
Rename Central command to centrals to align with API resource naming …
SimonBaeumer May 10, 2023
9abece0
ROX-16561: Do not export RDS/Postgres logs to CloudWatch for Probe in…
vladbologa May 11, 2023
5bb5eef
Directly manage Alertmanager configuration (#1022)
kylape May 11, 2023
8db3107
Change secret key to alertmanager.yaml (#1030)
kylape May 11, 2023
c35055d
ROX-17040: Tag instances created by the Probe service (#1024)
vladbologa May 15, 2023
ca5ee3f
Bump operator to v4.0.1 (#1033)
vladbologa May 15, 2023
d8be14b
Bump github.com/prometheus/common from 0.42.0 to 0.43.0 (#1031)
dependabot[bot] May 15, 2023
9dac410
Bump github.com/operator-framework/api from 0.17.4 to 0.17.5 (#1001)
dependabot[bot] May 15, 2023
86d166f
add FM_URL env variable for fmcurl script (#1029)
johannes94 May 16, 2023
657e370
Bump github.com/onsi/ginkgo/v2 from 2.9.2 to 2.9.5 (#1035)
dependabot[bot] May 16, 2023
fa26250
ROX-17002: Bump stackrox dependency (#1036)
dhaus67 May 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ jobs:
uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: "1.19"
go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache go module
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-data-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:
contents: read
environment: ${{ inputs.github_environment }}
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -81,10 +81,10 @@ jobs:
contents: read
environment: ${{ inputs.github_environment }}
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
with:
acs_environment: stage
github_environment: stage
deploy_clusters: "acs-stage-dp-02 acs-stage-eu-01 acs-stage-eu-02"
deploy_clusters: "acs-stage-dp-02 acs-stage-eu-02"
probe_clusters: "acs-stage-dp-02 acs-stage-eu-02"
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-python@v3
- uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
- uses: pre-commit/[email protected]
- uses: pre-commit/[email protected]
name: Verify generated files are up-to-date
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/probe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: "1.19"
go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache go module
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/rds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ on:
- 'docs/**'
- 'pkg/api/openapi/docs/**'
- 'pkg/api/openapi/.openapi-generator-ignore'
- 'dp-terraform/**'

jobs:
verify-test:
Expand All @@ -43,10 +44,10 @@ jobs:
contents: read
environment: development
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: "1.19"
go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache go module
Expand All @@ -67,4 +68,4 @@ jobs:
AWS_AUTH_HELPER: "none"
run: |
./dev/env/scripts/exec_fleetshard_sync.sh make test/rds
timeout-minutes: 35
timeout-minutes: 50
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ linters-settings:
require-explanation: false # don't require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped
staticcheck:
go: "1.19"
go: "1.20"
checks: [ all,-ST1000,-ST1001,-ST1003,-ST1005,-SA1019,-SA4001,-ST1016 ]
wrapcheck:
# ignoreSigRegexps: uncomment to add ignore rules
Expand Down
2 changes: 1 addition & 1 deletion .openshift-ci/e2e-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

RUN dnf update -y --disablerepo=\* --enablerepo=baseos,appstream && dnf -y install make which git gettext jq gcc && dnf clean all && rm -rf /var/cache/dnf

COPY --from=registry.ci.openshift.org/openshift/release:golang-1.19 /usr/local/go /usr/local/go
COPY --from=registry.ci.openshift.org/stolostron/builder:go1.20-linux /usr/local/go /usr/local/go
COPY --from=quay.io/openshift/origin-cli:4.13 /usr/bin/oc /usr/bin
COPY --from=quay.io/operator-framework/operator-sdk:v1.25 /usr/local/bin/operator-sdk /usr/local/bin

Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ repos:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
- repo: https://github.com/golangci/golangci-lint
rev: v1.51.1
rev: v1.52.2
hooks:
- id: golangci-lint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
args: ["--markdown-linebreak-ext=md"]
- id: end-of-file-fixer
exclude: '^(?:secrets/db.*|internal/dinosaur/pkg/api/(admin|private|public)/.*|pkg/client/redhatsso/api/.*)$' # Matches either secrets/db.* files or the generated files under internal/dinosaur/pkg/api/(admin|private|public) and pkg/client/redhatsso/client/api.
- id: check-json
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
rev: v0.9.0.2
hooks:
- id: shellcheck
# Ignore scripts generated by openapi-generator.
Expand Down
13 changes: 11 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,22 @@
"line_number": 86
}
],
"dp-terraform/helm/rhacs-terraform/charts/observability/templates/01-operator-06-cr.yaml": [
{
"type": "Secret Keyword",
"filename": "dp-terraform/helm/rhacs-terraform/charts/observability/templates/01-operator-06-cr.yaml",
"hashed_secret": "3e513f12b341ed3327bea645a728401b5d0f9ddb",
"is_verified": false,
"line_number": 15
}
],
"fleetshard/pkg/central/cloudprovider/dbclient_moq.go": [
{
"type": "Secret Keyword",
"filename": "fleetshard/pkg/central/cloudprovider/dbclient_moq.go",
"hashed_secret": "80519927d0f3ce1efe933f46ca9e05e68e491adc",
"is_verified": false,
"line_number": 118
"line_number": 127
}
],
"internal/dinosaur/pkg/api/public/api/openapi.yaml": [
Expand Down Expand Up @@ -546,5 +555,5 @@
}
]
},
"generated_at": "2023-03-28T21:54:47Z"
"generated_at": "2023-05-10T10:12:08Z"
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.ci.openshift.org/openshift/release:golang-1.19 AS build
FROM registry.ci.openshift.org/stolostron/builder:go1.20-linux AS build

ENV GOFLAGS="-mod=mod"

Expand Down
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,10 @@ test: $(GOTESTSUM_BIN)
# Runs the AWS RDS integration tests.
test/rds: $(GOTESTSUM_BIN)
RUN_RDS_TESTS=true \
$(GOTESTSUM_BIN) --junitfile data/results/rds-integration-tests.xml --format $(GOTESTSUM_FORMAT) -- -p 1 -v -timeout 30m -count=1 \
$(GOTESTSUM_BIN) --junitfile data/results/rds-integration-tests.xml --format $(GOTESTSUM_FORMAT) -- -p 1 -v -timeout 45m -count=1 \
./fleetshard/pkg/central/cloudprovider/awsclient/...
.PHONY: test/rds

# Precompile everything required for development/test.
test/prepare:
$(GO) test -i ./internal/dinosaur/test/integration/...
.PHONY: test/prepare

# Runs the integration tests.
#
# Args:
Expand All @@ -345,7 +340,7 @@ test/prepare:
# make test/integration TESTFLAGS="-run TestAccounts" acts as TestAccounts* and run TestAccountsGet, TestAccountsPost, etc.
# make test/integration TESTFLAGS="-run TestAccountsGet" runs TestAccountsGet
# make test/integration TESTFLAGS="-short" skips long-run tests
test/integration/dinosaur: test/prepare $(GOTESTSUM_BIN)
test/integration/dinosaur: $(GOTESTSUM_BIN)
$(GOTESTSUM_BIN) --junitfile data/results/fleet-manager-integration-tests.xml --format $(GOTESTSUM_FORMAT) -- -p 1 -ldflags -s -v -timeout $(TEST_TIMEOUT) -count=1 $(TESTFLAGS) \
./internal/dinosaur/test/integration/...
.PHONY: test/integration/dinosaur
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ACS fleet-manager repository for the ACS managed service.

#### Prerequisites

* [Golang 1.19+](https://golang.org/dl/)
* [Golang 1.20+](https://golang.org/dl/)
* [Docker](https://docs.docker.com/get-docker/) - to create database
* [ocm cli](https://github.com/openshift-online/ocm-cli/releases) - ocm command line tool
* [Node.js v12.20+](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
Expand Down
5 changes: 4 additions & 1 deletion cmd/fleet-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package main
import (
"flag"

"github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/cmd/admin"
"github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/cmd/centrals"
"github.com/stackrox/acs-fleet-manager/pkg/cmd/migrate"
"github.com/stackrox/acs-fleet-manager/pkg/cmd/serve"

Expand Down Expand Up @@ -46,8 +48,9 @@ func main() {

rootCmd.AddCommand(migrate.NewMigrateCommand(env))
rootCmd.AddCommand(serve.NewServeCommand(env))
rootCmd.AddCommand(centrals.NewCentralsCommand())
rootCmd.AddCommand(admin.NewAdminCommand())
// Unsupported CLI commands. Eventually some of them can be removed.
// rootCmd.AddCommand(central.NewCentralCommand(env))
// rootCmd.AddCommand(cluster.NewClusterCommand(env))
// rootCmd.AddCommand(cloudprovider.NewCloudProviderCommand(env))
// rootCmd.AddCommand(observatorium.NewRunObservatoriumCommand(env))
Expand Down
7 changes: 7 additions & 0 deletions deploy/helm/probe/templates/01-operator-04-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,11 @@ spec:
ports:
- name: monitoring
containerPort: 7070
resources:
requests:
cpu: {{ .Values.resources.requests.cpu | quote }}
memory: {{ .Values.resources.requests.memory | quote }}
limits:
cpu: {{ .Values.resources.limits.cpu | quote }}
memory: {{ .Values.resources.limits.memory | quote }}
terminationGracePeriodSeconds: 300
7 changes: 7 additions & 0 deletions deploy/helm/probe/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ redHatSSO:
clientSecret: ""
endpoint: "https://sso.redhat.com"
realm: "redhat-external"
resources:
limits:
cpu: "100m"
memory: "128Mi"
requests:
cpu: "100m"
memory: "128Mi"
1 change: 1 addition & 0 deletions dev/config/dataplane-cluster-configuration-crc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ clusters:
provider_type: standalone
supported_instance_type: "eval,standard"
cluster_dns: apps-crc.testing
multi_az: true
available_central_operator_versions:
- version: "0.1.0"
ready: true
Expand Down
60 changes: 60 additions & 0 deletions docs/development/howto-e2e-test-rds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# How to e2e test RDS

At the point in time this documentation was written AWS RDS DB creation and deletion is not e2e tested with a full setup of fleet-manager and fleetshard-sync. Everytime a change to the RDS provisioning logic is introduced we need to e2e test that change manually using the steps described here.

**Prerequisites:**

- A K8s cluster to create central resources on (using CRC as an example here)
- Kubeconfig configured with access to that cluster
- Setup personal AWS access through `aws-saml.py` (see [secret-management.md](./secret-management.md))
- RHACS Operator running or installed in the cluster

1. Run local fleet-manager

```
make db/teardown db/setup db/migrate

make binary

./fleet-manager serve --dataplane-cluster-config-file ./dev/config
```

1. Run local fleetshard-sync

```
# Prepare environment and secrets
export PATH="$PATH:$(pwd)/bin"
source ./scripts/lib/external_config.sh
kinit # get a kerberos ticket
export AWS_AUTH_HELPER=aws-saml
init_chamber
# When prompted select your profile for the dev AWS account arn:aws:iam::047735621815:role/047735621815-poweruser

source <(run_chamber env "fleetshard-sync")
source <(run_chamber env -b secretsmanager "fleetshard-sync")
source <(run_chamber env "local_cluster")
export MANAGED_DB_ENABLED=true
# flip the PublicAcessible flag to true in rds.go line 354
make binary

./fleetshard-sync
```

1. Create a central instance and wait for DB Creation

```
central_id=$(./scripts/create-centrals.sh | jq '.id' -r)
# Watch the fleetshard-sync logs to tell what's happening in the background.
# It should print something like this if everything works like expected:
# RDS instance status: creating (instance ID: rhacs-chcb5m8ah6b2ko6qut0g-db-instance)

# At some point your central instance should become ready
```

1. Make sure DB state is available and 2 instances exist in state available the central pod is ready
1. Delete the central

```
export OCM_TOKEN=$(ocm token)
./scripts/fmcurl "rhacs/v1/centrals/$central_id?async=true" -XDELETE
```
2 changes: 2 additions & 0 deletions dp-terraform/helm/rhacs-terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Run the script for your environment and cluster name:
The env var `FM_ENDPOINT` should point to an endpoint for the fleet manager. An option to use a fleet manager instance running in your laptop is to [setup ngrok](https://ngrok.com/docs/getting-started), launch the fleet manager, and run `ngrok http 8000` to expose it to the internet. That commands outputs an endpoint that you can use for `FM_ENDPOINT`.
To get the cluster id for staging look for `cluster_id` in `dev/config/dataplane-cluster-configuration-staging.yaml` file. Export that value to environment variable `export CLUSTER_ID="<cluster_id from config file>"`.

The FLEETSHARD_SYNC_<CPU|MEMORY>_<REQUEST|LIMIT> environment variables can be used to override the default values for the fleetshard-sync container resource requests and limits. See the `terraform_cluster.sh` for the current default values.

**Create values file**

Create a file `~/acs-terraform-values.yaml` with the values for the parameters in [values.yaml](./values.yaml) that are missing or that you want to override. That file will contain credentials, so make sure you put it in a safe location, and with suitable permissions.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v1
kind: Secret
metadata:
name: rhacs-alertmanager-configuration
namespace: {{ include "observability.namespace" . }}
stringData:
alertmanager.yaml: |
global:
resolve_timeout: 5m
route:
receiver: default-receiver
repeat_interval: 12h
routes:
- receiver: managed-rhacs-pagerduty
match:
observability: managed-rhacs
severity: critical
- receiver: managed-rhacs-deadmanssnitch
repeat_interval: 5m
match:
alertname: DeadMansSwitch
observability: managed-rhacs
receivers:
- name: default-receiver
- name: managed-rhacs-pagerduty
pagerduty_configs:
- service_key: {{ .Values.pagerduty.key | quote }}
- name: managed-rhacs-deadmanssnitch
webhook_configs:
- url: {{ .Values.deadMansSwitch.url | quote }}
type: Opaque

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@ spec:
source: observability-operator-manifests
sourceNamespace: {{ include "observability.namespace" . }}
startingCSV: observability-operator.{{ .Values.observabilityOperatorVersion }}
config:
resources:
requests:
cpu: {{ .Values.observabilityOperator.resources.requests.cpu | quote }}
memory: {{ .Values.observabilityOperator.resources.requests.memory | quote }}
limits:
cpu: {{ .Values.observabilityOperator.resources.limits.cpu | quote }}
memory: {{ .Values.observabilityOperator.resources.limits.memory | quote }}
Loading