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

Capabilities v2 #357

Merged
merged 52 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d80ea8f
capabilitiesv2: preparing doc
eguzki Apr 21, 2020
e53ffb1
binding, api, limit, mapping_rule, metric, plan CRD's removed
eguzki Apr 27, 2020
64a38d0
capabilities v1beta1 APIs and CRDs scaffolding
eguzki Apr 27, 2020
0bae18b
capabilitiesv2: backend_types product_types
eguzki May 5, 2020
0de7dbf
capabilitiesv2: account provider object removed
eguzki May 7, 2020
51780d8
capabilitiesv2: product controller
eguzki May 11, 2020
c4393bf
Makefile: enable debug log for local run
eguzki May 14, 2020
7f0df1f
product, backend crd updated
eguzki May 15, 2020
cf55a84
capabilitiesV2: backend controller
eguzki May 15, 2020
6192fee
http client verbose activated by THREESCALE_DEBUG envvar
eguzki May 15, 2020
cb42dc2
capabilitiesV2: backend methods
eguzki Jun 2, 2020
ef7b68b
capabilitiesV2: backend metrics
eguzki Jun 3, 2020
0558160
capabilitiesV2: backend mappingrules
eguzki Jun 5, 2020
2ac6575
capabilitiesV2: product metrics methods mappingrules
eguzki Jun 5, 2020
fe6847f
capabilitiesV2: product backend usages
eguzki Jun 6, 2020
89eaf3e
capabilitiesV2: refactor product reconciler
eguzki Jun 9, 2020
4429a5a
capabilitiesV2: product crd custom oneof validations
eguzki Jun 9, 2020
ce9eacb
capabilitiesV2: product proxy conf
eguzki Jun 9, 2020
32dd487
capabilitiesV2: product refactor
eguzki Jun 11, 2020
d88b722
capabilitiesV2: product application plans
eguzki Jun 11, 2020
e9a87a9
fixup! capabilitiesV2: product application plans
eguzki Jun 11, 2020
a8d89ed
capabilitiesV2: backend status condition fix
eguzki Jun 11, 2020
a939ced
capabilitiesV2: product status condition fix
eguzki Jun 11, 2020
af3893c
capabilitiesV2: application plans limits and pricingrules
eguzki Jun 15, 2020
eafca1a
capabilitiesV2: promote proxy config to staging env
eguzki Jun 19, 2020
752652a
3scale-porta-go-client updated to 0.0.4
eguzki Jun 22, 2020
5044287
remove unused test helper method
eguzki Jun 22, 2020
6a0ad16
capabilititesv2: proxy not promoted to staging
eguzki Jun 22, 2020
a08a0e2
capabilitiesv2: doc
eguzki Jun 19, 2020
a8904b0
capabilitiesv2: backend doc
eguzki Jun 22, 2020
dc65913
capabilitiesv2: backend CRD updated and CRD tests added
eguzki Jun 22, 2020
6303312
account and activedocs scaffolding removed
eguzki Jun 23, 2020
fe1b1c6
account and activedocs scaffolding removed from CSV
eguzki Jun 23, 2020
1e13798
account and activedocs crd symlinks removed
eguzki Jun 23, 2020
86038e4
account and activedocs scaffolding removed
eguzki Jun 23, 2020
383073c
product mapping rule increment field required
eguzki Jun 25, 2020
4b0d026
backend mapping rule increment field required
eguzki Jun 25, 2020
231a7c7
openapi generation
eguzki Jun 25, 2020
6b7f6ed
capabilitiesv2: product doc
eguzki Jun 23, 2020
618a84d
fix rebase issues
eguzki Jun 26, 2020
618a0de
capabilities doc: fix small issue
eguzki Jun 26, 2020
ccd796d
backend, product CRD tests
eguzki Jun 26, 2020
3582758
CSV update with new backend and product examples
eguzki Jun 26, 2020
d32060e
rebase fix crd tests
eguzki Jun 26, 2020
30b488c
openapi generate
eguzki Jun 26, 2020
1301f90
status condition optional fields
eguzki Jun 29, 2020
8e073f0
rebase little updates
eguzki Jun 29, 2020
a7fb7e8
typo comments
eguzki Jun 29, 2020
81f881a
DisplayName for backend CRD
eguzki Jun 29, 2020
113da97
remove status.ErrorMessage from product and backend
eguzki Jun 30, 2020
8d2970a
Backend CRD private base url as required
eguzki Jun 30, 2020
a3c1b52
fixed typo in MethodSpec
eguzki Jun 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ pull:
tag:
$(DOCKER) tag $(IMAGE):$(SOURCE_VERSION) $(IMAGE):$(VERSION)

## local: push operator docker image to remote repo
## local: Run operator locally
local:
OPERATOR_NAME=$(OPERATOR_NAME) $(OPERATOR_SDK) run --local --namespace $(NAMESPACE)
OPERATOR_NAME=$(OPERATOR_NAME) THREESCALE_DEBUG=1 $(OPERATOR_SDK) run --local --namespace $(NAMESPACE) --operator-flags '--zap-devel=true --zap-level 1'

## e2e-setup: create OCP project for the operator
e2e-setup:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Current *capabilities* state: **Full Lifecycle**
* **Upgrade**: Upgrade from previously installed 3scale API Management solution
* **Reconciliation**: Tunable CRD parameters after 3scale API Management solution has been installed
* Tech Preview
* **Application Capabilities via Operator**: Allow interacting with underlying 3scale API Management solution. Expose objects like *tenants*, *api*, *metric*, *limits* as _Custom Resource_ objects.
* **Application Capabilities via Operator**: Allow interacting with underlying 3scale API Management solution. Expose objects like *tenant*, *product*, *backend* as _Custom Resource_ objects.

## User Guide

Expand Down
9 changes: 3 additions & 6 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/3scale/3scale-operator/pkg/3scale/amp/product"
"github.com/3scale/3scale-operator/pkg/apis"
capabilitiesv1beta1 "github.com/3scale/3scale-operator/pkg/apis/capabilities/v1beta1"
appsv1alpha1 "github.com/3scale/3scale-operator/pkg/apis/apps/v1alpha1"
"github.com/3scale/3scale-operator/pkg/common"
"github.com/3scale/3scale-operator/pkg/controller"
Expand Down Expand Up @@ -285,14 +286,10 @@ func filterGKVsFromAddToScheme(gvks []schema.GroupVersionKind) []schema.GroupVer
schema.GroupVersionKind{Group: "apps.openshift.io", Kind: "DeploymentConfig", Version: matchAnyValue},

// Custom resource types
schema.GroupVersionKind{Group: "capabilities.3scale.net", Kind: "Plan", Version: matchAnyValue},
schema.GroupVersionKind{Group: "capabilities.3scale.net", Kind: "API", Version: matchAnyValue},
schema.GroupVersionKind{Group: "capabilities.3scale.net", Kind: "Limit", Version: matchAnyValue},
schema.GroupVersionKind{Group: "capabilities.3scale.net", Kind: "MappingRule", Version: matchAnyValue},
schema.GroupVersionKind{Group: "capabilities.3scale.net", Kind: "Tenant", Version: matchAnyValue},
schema.GroupVersionKind{Group: "capabilities.3scale.net", Kind: "Metric", Version: matchAnyValue},
schema.GroupVersionKind{Group: "capabilities.3scale.net", Kind: "Binding", Version: matchAnyValue},
schema.GroupVersionKind{Group: "apps.3scale.net", Kind: "APIManager", Version: matchAnyValue},
eguzki marked this conversation as resolved.
Show resolved Hide resolved
schema.GroupVersionKind{Group: "capabilities.3scale.net", Kind: capabilitiesv1beta1.ProductKind, Version: matchAnyValue},
schema.GroupVersionKind{Group: "capabilities.3scale.net", Kind: capabilitiesv1beta1.BackendKind, Version: matchAnyValue},
}

ownGVKs := []schema.GroupVersionKind{}
Expand Down
569 changes: 0 additions & 569 deletions deploy/crds/capabilities.3scale.net_apis_crd.yaml

This file was deleted.

183 changes: 183 additions & 0 deletions deploy/crds/capabilities.3scale.net_backends_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: backends.capabilities.3scale.net
spec:
group: capabilities.3scale.net
names:
kind: Backend
listKind: BackendList
plural: backends
singular: backend
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: Backend is the Schema for the backends API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: BackendSpec defines the desired state of Backend
properties:
description:
description: Description is a human readable text of the backend
type: string
mappingRules:
items:
description: MappingRuleSpec defines the desired state of Product's
MappingRule
properties:
httpMethod:
enum:
- GET
- HEAD
- POST
- PUT
- DELETE
- OPTIONS
- TRACE
- PATCH
- CONNECT
type: string
increment:
type: integer
metricMethodRef:
type: string
pattern:
type: string
position:
type: integer
required:
- httpMethod
- increment
- metricMethodRef
- pattern
type: object
type: array
methods:
additionalProperties:
description: MethodSpec defines the desired state of Product's Method
properties:
description:
type: string
friendlyName:
type: string
required:
- friendlyName
type: object
description: 'Methods Map: system_name -> MethodSpec system_name attr
is unique for all metrics AND methods In other words, if metric''s
system_name is A, there is no metric or method with system_name A.'
type: object
metrics:
additionalProperties:
description: MetricSpec defines the desired state of Product's Metric
properties:
description:
type: string
friendlyName:
type: string
unit:
type: string
required:
- friendlyName
- unit
type: object
description: 'Metrics Map: system_name -> MetricSpec system_name attr
is unique for all metrics AND methods In other words, if metric''s
system_name is A, there is no metric or method with system_name A.'
type: object
name:
description: Name is human readable name for the backend
type: string
privateBaseURL:
description: PrivateBaseURL Private Base URL of the API
pattern: ^https?:\/\/.*$
type: string
providerAccountRef:
description: ProviderAccountRef references account provider credentials
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
systemName:
description: SystemName identifies uniquely the product within the account
provider Default value will be sanitized Name
type: string
required:
- name
- privateBaseURL
type: object
status:
description: BackendStatus defines the observed state of Backend
properties:
backendId:
format: int64
type: integer
conditions:
description: Current state of the 3scale backend. Conditions represent
the latest available observations of an object's state
items:
description: "Condition represents an observation of an object's state.
Conditions are an extension mechanism intended to be used when the
details of an observation are not a priori known or would not apply
to all instances of a given Kind. \n Conditions should be added
to explicitly convey properties that users and components care about
rather than requiring those properties to be inferred from other
observations. Once defined, the meaning of a Condition can not be
changed arbitrarily - it becomes part of the API, and has the same
backwards- and forwards-compatibility concerns of any other part
of the API."
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
description: ConditionReason is intended to be a one-word, CamelCase
representation of the category of cause of the current status.
It is intended to be used in concise output, such as one-line
kubectl get output, and in summarizing occurrences of causes.
type: string
status:
type: string
type:
description: "ConditionType is the type of the condition and is
typically a CamelCased word or short phrase. \n Condition types
should indicate state in the \"abnormal-true\" polarity. For
example, if the condition indicates when a policy is invalid,
the \"is valid\" case is probably the norm, so the condition
should be called \"Invalid\"."
type: string
required:
- status
- type
type: object
type: array
observedGeneration:
description: ObservedGeneration reflects the generation of the most
recently observed Backend Spec.
format: int64
type: integer
type: object
type: object
version: v1beta1
versions:
- name: v1beta1
served: true
storage: true
133 changes: 0 additions & 133 deletions deploy/crds/capabilities.3scale.net_bindings_crd.yaml

This file was deleted.