Skip to content

Commit ecd63b5

Browse files
authored
Dictionary-based API and Multi-Cloud Support (#119)
* servicetelemetry.infra.watch update to v2alpha1 Defaults need to nest under servicetelemetry_defaults Update CRD to new object-based schema Adjust defaults and vars to match new CRD [untested] Check in point of CRD conversion Hit a milestone that I wanted to get checked into the repository. This includes some additional changes in the CRD to better align the storage configuration story. Starts to update a couple of templates for use with the new schema. Nothing is tested yet since I expect the deployments to fail. Update CI automation (#132) Update the CI automation to account for new bundle format within the Smart Gateway Operator and Service Telemetry Operator repositories. [milestone] Backend deployments are working Backend deployments are now working and debugging output of the list of clouds is now working. Empty storage object breaks Prometheus * Adjust defaults for highAvailability Adjust the setup of a nested dictionary defaults when highAvailable.enabled is set to a value of true. * Create block to manage HA variables * Draft implementation of multi-cloud support Provide a draft implementation of the multi-cloud support. Updates the CRD to account for recent changes with inability to merge lists of objects easily. In return this adds new functionality that will remove old SmartGateways should they be removed from the current list. Adds the operator_sdk/util collection so that the k8s_status module is provided. Adds initial support for a custom status notifying the admin that ephemeral storage is in place and is not recommended. Will update statusDescriptors to make this obvious in the UI. Removes unneeded component files and merges all logic into a single component_clouds.yml file. * Update bundle CRD * Bump CRD version to v1 and cleanup Perform a bit of cleanup and bump the apiVersion of the CRD API to v1 * Only create SGs when supporting backend available * Revert changes to CRD apiVersion v1 Revert the changes to the CRD apiVersion bump since it seems to be incompatible with the current bundle setup with operator-sdk 0.17.2. Catch up on current specDescriptor changes as well. * Fix issue introduced in revert * Non-functioning dual-API version support * Set v1alpha1 descriptors to previous setup * Add v1alpha1 backwards compatibility * Update to operator-sdk 0.19, pass bundle validation * Fix service monitor variable configuration * Fix ansible linting and invalid variable usage * Change naming format of SmartGateway objects Changed the naming format of the SmartGateway objects because it was causing the labels for the ConfigMap hash to overflow past the 63 char limit. In the future we're probably going to have to add some extra checks in STO to make sure it doesn't cause a naming length failure. I've adjusted some of the naming to be less verbose overall as well. * Don't double define SmartGateway object name * Compact logic for SG naming * Drop outdated test-local directory * Environment changes for CI and smoketests * ServiceTelemetry object renaming effort * Adjust author email in ansible metadata * Migrate 1.1.0 directory to manifests/ * Update ServiceTelemetry UI hints Update the specDescriptors and statusDescriptors for the supported parameters in the new ServiceTelemetry API.: * Revert change in default example functionality * Remove superfluous merge type setting in k8s module
1 parent bd478f0 commit ecd63b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1407
-792
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
env:
22
global:
3-
- RELEASE_VERSION: v0.17.2
3+
- RELEASE_VERSION: v0.19.4
44
- secure: yh7EteqkcgDVgnMzuGb1rOtvMVP0iytjYG6qbaxDxv2zCgFllVWtMNiiBu9J79WXkLYA+QXDDb6oKeNAWeDo8o9rZQdiRgXtB0/SJ8ivKeFv3D1/52X8RqpJjpMWLT83rHWGYi2RDnEDU0MbxAR1XT4K9lRMN44U2VowNb2+h1+eCQG33plgECeqH9duGdcII75xf6v/dbta7AoDKuYGGzmOxU31CgK9wCoOT1/33K0UjrAhRxyu7NstFRWe6Exdq9RwG4Pk5BuJN5yWonb1OUeIGCVmO37D4Io/61tZUtTb3XIveVzYB8OA3H6ny+1QAsCaVqvOBzE8BKOxAtnx8lF70l7prKuJ1w+NiMB+cGDi2Kso+GhEvbhvmObuQ07Cyc9J6TOOqg2eLlx88HvTCQHrD+HKdytoD0c1TgXBsFtBoUk/H46mOhP97o6lgJ45n9EwcoOnBp1pwAqcnDVIenZxJaHi61nPZxMTUmrJKyO6MfFiJbV5c8wPmK6Ilg+M/44GuEr9Gj7GplZRv1z21YU6EyAeBfNemt5oFLzNF8Lb+KlpD5GKiRzZBfcHdd/eSw3DP2E+6WQLSvYviwrZxtYSLFjwPwfIVqmGN2Q3yCFRSdO2upSl43QGg6XaKyHFZDwuQ8y1HVC9VG6pz4qOpkSr6GuV17/d9x4k3fZ6RCk=
55
- secure: ojZXqjvCIqIbXJN13fma6rMH9A0y4b0B1Z9g/hG5ll3Dw76C6GnoxaH5tzAQuUEa3PgPG6oLsgmKr0drMZ4x6YESSVzLq2JIDUfct/qrYQ4CsUB9IjqO/8S2hxxMYsNbfLars34s6MTzNvReqMIMrxDPTEwc84a6jnmvIaFTTaqN4jQHrspZXcLD479muf1++YFnUgdobBKeS0XofZ/umRtW4thHv/yLSX2dcZ92Hz4Ad//YOromLunCfG1O6F7ggMEmEI4cuUp0J+TjBV4TdRnJz+T3ljAibgudSjUWVXSftxCei8CbwGuCK3f0UsQHS8qTBpylbt5iCFJEQf1MdFHi+yZY26jZqYZNboUmH7swPsA38je3Nd6siIXzPllf1B34O5xBubJ+CCqIBpNUe9cfJOqJ5EoibGYTuQmLdEwwY9OYd2dFvRtflSrKCHbz/8DgBmW+K8L1qGja2J069p0Ef7nuZpnhUqYB/mhExTb7hCKZeIKsVCIlmXzSTYqV8+HcyiQjol1eqehDjNrFaumVO5LX48APe1QpHClB/6uM74ZfCc4xa9UO0soBEYp8dOPsI3fbrRfVBI4gogv9/OLQFWTFZ1SKnjCYMcotFosoxp8x5ETki/VwGNCH0zobrFefnB4U4uX7NsrO4Vrx2zbur1/6NrhX1MChfGjZ1ok=
66

@@ -20,8 +20,8 @@ before_install:
2020

2121
install:
2222
- pip install ansible-lint
23+
- ansible-galaxy collection install operator_sdk.util
2324

2425
script:
25-
- ansible-lint roles/smartgateway/
26+
- ansible-lint roles/servicetelemetry
2627
- operator-sdk bundle validate --verbose ./deploy/olm-catalog/service-telemetry-operator
27-

build/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ FROM quay.io/operator-framework/ansible-operator:v0.16.0
22

33
COPY watches.yaml ${HOME}/watches.yaml
44
COPY roles/ ${HOME}/roles/
5+
COPY collections/ ${HOME}/.ansible/collections/

build/metadata.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55

66
# Configure these
77
OPERATOR_NAME=${OPERATOR_NAME:-service-telemetry-operator}
8-
CSV_VERSION=${CSV_VERSION:-1.1.0}
98
IMAGE_BUILDER=${IMAGE_BUILDER:-podman}
109
IMAGE_BUILD_ARGS=${IMAGE_BUILD_ARGS:-''}
1110
IMAGE_TAG=${IMAGE_TAG:-latest}
12-
REQUIRED_OPERATOR_SDK_VERSION=${REQUIRED_OPERATOR_SDK_VERSION:-v0.15.2}
13-
SERVICE_TELEMETRY_SUBSCRIPTION=${SERVICE_TELEMETRY_SUBSCRIPTION:-servicetelemetry-operator-stable-infrawatch-operators-openshift-marketplace}
11+
REQUIRED_OPERATOR_SDK_VERSION=${REQUIRED_OPERATOR_SDK_VERSION:-v0.19.4}
12+
SERVICE_TELEMETRY_SUBSCRIPTION=${SERVICE_TELEMETRY_SUBSCRIPTION:-service-telemetry-operator-stable-infrawatch-operators-openshift-marketplace}
1413

1514
# Automatic
16-
CSV_FILE=${CSV_FILE:-"deploy/olm-catalog/${OPERATOR_NAME}/${CSV_VERSION}/${OPERATOR_NAME}.v${CSV_VERSION}.clusterserviceversion.yaml"}
15+
CSV_FILE=${CSV_FILE:-"deploy/olm-catalog/${OPERATOR_NAME}/manifests/${OPERATOR_NAME}.clusterserviceversion.yaml"}
1716

1817
# Vars below here are for LOCAL DEV ONLY
1918
#

build/stf-run-ci/tasks/deploy_stf.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,25 @@
33
- name: Create default ServiceTelemetry manifest
44
set_fact:
55
service_telemetry_manifest: |
6-
apiVersion: infra.watch/v1alpha1
6+
apiVersion: infra.watch/v1beta1
77
kind: ServiceTelemetry
88
metadata:
9-
name: stf-default
9+
name: default
1010
namespace: "{{ namespace }}"
1111
spec:
12-
eventsEnabled: {{ __service_telemetry_events_enabled }}
13-
highAvailabilityEnabled: {{ __service_telemetry_high_availability_enabled }}
14-
metricsEnabled: {{ __service_telemetry_metrics_enabled }}
15-
storageEphemeralEnabled: {{ __service_telemetry_storage_ephemeral_enabled }}
12+
backends:
13+
events:
14+
elasticsearch:
15+
enabled: {{ __service_telemetry_events_enabled }}
16+
storage:
17+
strategy: {{ __service_telemetry_storage_ephemeral_enabled }}
18+
metrics:
19+
prometheus:
20+
enabled: {{ __service_telemetry_metrics_enabled }}
21+
storage:
22+
strategy: {{ __service_telemetry_storage_ephemeral_enabled }}
23+
highAvailability:
24+
enabled: {{ __service_telemetry_high_availability_enabled }}
1625
when: service_telemetry_manifest is not defined
1726

1827
- name: Create ServiceTelemetry instance

build/stf-run-ci/tasks/setup_base.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
- name: Create OperatorGroup
1818
k8s:
1919
definition:
20-
apiVersion: operators.coreos.com/v1alpha2
20+
apiVersion: operators.coreos.com/v1
2121
kind: OperatorGroup
2222
metadata:
23-
name: service-telemetry-og
23+
name: service-telemetry-operator-group
2424
namespace: "{{ namespace }}"
2525
spec:
2626
targetNamespaces:
@@ -40,7 +40,6 @@
4040
name: amq7-cert-manager
4141
source: redhat-operators
4242
sourceNamespace: openshift-marketplace
43-
startingCSV: amq7-cert-manager.v1.0.0
4443

4544
- name: Enable OperatorHub.io for Elastic Cloud on Kubernetes
4645
k8s:
@@ -70,7 +69,6 @@
7069
name: elastic-cloud-eck
7170
source: operatorhubio-operators
7271
sourceNamespace: openshift-marketplace
73-
startingCSV: elastic-cloud-eck.v1.1.2
7472

7573
- name: Subscribe to AMQ Interconnect Operator
7674
k8s:
@@ -86,7 +84,6 @@
8684
name: amq7-interconnect-operator
8785
source: redhat-operators
8886
sourceNamespace: openshift-marketplace
89-
startingCSV: amq7-interconnect-operator.v1.2.0
9087

9188
- name: Subscribe to Prometheus Operator
9289
k8s:

build/stf-run-ci/tasks/setup_stf.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
apiVersion: operators.coreos.com/v1alpha1
2424
kind: Subscription
2525
metadata:
26-
name: servicetelemetry-operator-stable-infrawatch-operators-openshift-marketplace
26+
name: service-telemetry-operator-stable-infrawatch-operators-openshift-marketplace
2727
namespace: "{{ namespace }}"
2828
spec:
2929
channel: stable
3030
installPlanApproval: Automatic
31-
name: servicetelemetry-operator
31+
name: service-telemetry-operator
3232
source: infrawatch-operators
3333
sourceNamespace: openshift-marketplace
3434
when: service_telemetry_operator_subscription_manifest is not defined

build/stf-run-ci/tasks/setup_stf_local_build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
- name: Replace SG image path in STO CSV
5757
replace:
5858
path: working/service-telemetry-operator.clusterserviceversion.yaml
59-
regexp: '(\s+)image: quay\.io/infrawatch/service-telemetry-operator\:.+$'
59+
regexp: '(\s+)image: image-registry\.openshift-image-registry\.svc\:5000/service-telemetry/service-telemetry-operator\:.+$'
6060
replace: '\1image: {{ sto_image_path }}'
6161

6262
- name: Replace namespace in STO CSV

build/test-local/start.sh

-6
This file was deleted.

build/travis/after_success.sh

-14
This file was deleted.

build/validate_deployment.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ set -e
33

44
# Play the (automated!) waiting game
55
echo -e "\n* [info] Waiting for QDR deployment to complete\n"
6-
until timeout 300 oc rollout status deployment.apps/stf-default-interconnect; do sleep 3; done
6+
until timeout 300 oc rollout status deployment.apps/default-interconnect; do sleep 3; done
77
echo -e "\n* [info] Waiting for prometheus deployment to complete\n"
8-
until timeout 300 oc rollout status statefulset.apps/prometheus-stf-default; do sleep 3; done
8+
until timeout 300 oc rollout status statefulset.apps/prometheus-default; do sleep 3; done
99
echo -e "\n* [info] Waiting for elasticsearch deployment to complete \n"
1010
while true; do
1111
sleep 3
@@ -15,12 +15,12 @@ while true; do
1515
fi
1616
done
1717
echo -e "\n* [info] Waiting for alertmanager deployment to complete\n"
18-
until timeout 300 oc rollout status statefulset.apps/alertmanager-stf-default; do sleep 3; done
18+
until timeout 300 oc rollout status statefulset.apps/alertmanager-default; do sleep 3; done
1919
echo -e "\n* [info] Waiting for smart-gateway deployment to complete\n"
20-
until timeout 300 oc rollout status deployment.apps/stf-default-collectd-telemetry-smartgateway; do sleep 3; done
21-
until timeout 300 oc rollout status deployment.apps/stf-default-collectd-notification-smartgateway; do sleep 3; done
22-
until timeout 300 oc rollout status deployment.apps/stf-default-ceilometer-notification-smartgateway; do sleep 3; done
23-
until timeout 300 oc rollout status deployment.apps/stf-default-ceilometer-telemetry-smartgateway; do sleep 3; done
20+
until timeout 300 oc rollout status deployment.apps/default-cloud1-coll-meter-smartgateway; do sleep 3; done
21+
until timeout 300 oc rollout status deployment.apps/default-cloud1-coll-event-smartgateway; do sleep 3; done
22+
until timeout 300 oc rollout status deployment.apps/default-cloud1-ceil-event-smartgateway; do sleep 3; done
23+
until timeout 300 oc rollout status deployment.apps/default-cloud1-ceil-meter-smartgateway; do sleep 3; done
2424
echo -e "\n* [info] Waiting for all pods to show Ready/Complete\n"
2525
while oc get pods --selector '!openshift.io/build.name' | tail -n +2 | grep -v -E 'Running|Completed'; do
2626
sleep 3

deploy/configs/default.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
KIND_SERVICETELEMETRY="apiVersion: infra.watch/v1alpha1
22
kind: ServiceTelemetry
33
metadata:
4-
name: stf-default
4+
name: default
55
namespace: ${OCP_PROJECT}
66
spec:
77
metricsEnabled: true

deploy/configs/quicklab.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
KIND_SERVICETELEMETRY="apiVersion: infra.watch/v1alpha1
33
kind: ServiceTelemetry
44
metadata:
5-
name: stf-default
5+
name: default
66
namespace: service-telemetry
77
spec:
88
metricsEnabled: true

0 commit comments

Comments
 (0)