From bed5045832460c9d0f15f55dc98a18483ed228c7 Mon Sep 17 00:00:00 2001 From: TN340BK Date: Thu, 14 Jul 2022 13:51:36 -0400 Subject: [PATCH] Added all required files --- 3scale/base/backends/customer-order.yaml | 20 ++++++++++ 3scale/base/kustomization.yaml | 7 ++++ 3scale/base/products/customer.yaml | 40 +++++++++++++++++++ .../overlays/dev/backends/customer-order.yaml | 8 ++++ 3scale/overlays/dev/kustomization.yaml | 9 +++++ 3scale/overlays/dev/products/customer.yaml | 15 +++++++ gitops/Application_threescale-dev.yaml | 16 ++++++++ .../ClusterRole_gitops-threescale-access.yaml | 13 ++++++ 8 files changed, 128 insertions(+) create mode 100644 3scale/base/backends/customer-order.yaml create mode 100644 3scale/base/kustomization.yaml create mode 100644 3scale/base/products/customer.yaml create mode 100644 3scale/overlays/dev/backends/customer-order.yaml create mode 100644 3scale/overlays/dev/kustomization.yaml create mode 100644 3scale/overlays/dev/products/customer.yaml create mode 100644 gitops/Application_threescale-dev.yaml create mode 100644 rbac/ClusterRole_gitops-threescale-access.yaml diff --git a/3scale/base/backends/customer-order.yaml b/3scale/base/backends/customer-order.yaml new file mode 100644 index 0000000..df0bc52 --- /dev/null +++ b/3scale/base/backends/customer-order.yaml @@ -0,0 +1,20 @@ +apiVersion: capabilities.3scale.net/v1beta1 +kind: Backend +metadata: + name: customer-order +spec: + name: "customer-order" + systemName: "customer-order" + mappingRules: + - httpMethod: POST + pattern: "/customers/{id}/orders/{orderid}" + increment: 1 + metricMethodRef: hits + - httpMethod: GET + pattern: "/customers/{id}/orders/{orderid}" + increment: 1 + metricMethodRef: hits + - httpMethod: PUT + pattern: "/customers/{id}/orders/{orderid}" + increment: 1 + metricMethodRef: hits diff --git a/3scale/base/kustomization.yaml b/3scale/base/kustomization.yaml new file mode 100644 index 0000000..b05aa2b --- /dev/null +++ b/3scale/base/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +metadata: + name: 3scale +resources: +- products/customer.yaml +- backends/customer-order.yaml diff --git a/3scale/base/products/customer.yaml b/3scale/base/products/customer.yaml new file mode 100644 index 0000000..99364c3 --- /dev/null +++ b/3scale/base/products/customer.yaml @@ -0,0 +1,40 @@ +apiVersion: capabilities.3scale.net/v1beta1 +kind: Product +metadata: + name: customer +spec: + name: "customer" + deployment: + apicastSelfManaged: + stagingPublicBaseURL: "https://apis-3scale-base-staging.apps.cluster-2q76v.2q76v.sandbox955.opentlc.com:443" + productionPublicBaseURL: "https://apis-3scale-base.apps.cluster-2q76v.2q76v.sandbox955.opentlc.com:443" + authentication: + oidc: + issuerType: "keycloak" + authenticationFlow: + standardFlowEnabled: false + implicitFlowEnabled: false + serviceAccountsEnabled: true + directAccessGrantsEnabled: false + jwtClaimWithClientID: "azp" + jwtClaimWithClientIDType: "plain" + applicationPlans: + portal: + name: "customer" + published: true + appsRequireApproval: true + policies: + - name: apicast + version: builtin + enabled: true + configuration: {} + - name: headers + version: builtin + enabled: true + configuration: + request: + - value_type": "plain" + op: "set" + header": "Authorization" + value: "Basic dXNlcjpwYXNzd29yZA== + diff --git a/3scale/overlays/dev/backends/customer-order.yaml b/3scale/overlays/dev/backends/customer-order.yaml new file mode 100644 index 0000000..ae78dfb --- /dev/null +++ b/3scale/overlays/dev/backends/customer-order.yaml @@ -0,0 +1,8 @@ +apiVersion: capabilities.3scale.net/v1beta1 +kind: Backend +metadata: + name: customer-order +spec: + name: "customer-order" + systemName: "customer-order" + privateBaseURL: "http://customer-order.dev.svc.cluster.local:808080 diff --git a/3scale/overlays/dev/kustomization.yaml b/3scale/overlays/dev/kustomization.yaml new file mode 100644 index 0000000..038e3ed --- /dev/null +++ b/3scale/overlays/dev/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +metadata: + name: 3scale +resources: +- ../../base +patchesStrategicMerge: +- products/customer.yaml +- backends/customer-order.yaml diff --git a/3scale/overlays/dev/products/customer.yaml b/3scale/overlays/dev/products/customer.yaml new file mode 100644 index 0000000..d980ef4 --- /dev/null +++ b/3scale/overlays/dev/products/customer.yaml @@ -0,0 +1,15 @@ +apiVersion: capabilities.3scale.net/v1beta1 +kind: Product +metadata: + name: customer +spec: + deployment: + apicastSelfManaged: + stagingPublicBaseURL: "https://apis-3scale-dev-staging.apps.cluster-2q76v.2q76v.sandbox955.opentlc.com:443" + productionPublicBaseURL: "https://apis-3scale-dev.apps.cluster-2q76v.2q76v.sandbox955.opentlc.com:443" + authentication: + oidc: + issuerEndpoint: "https://zync-sso:b361ca5f-1646-4377-90dc-3f77dca10f40@sso-dev.apps.cluster-2q76v.2q76v.sandbox955.opentlc.com/auth/realms/dev" + backendUsages: + gav: + path: /customer/order diff --git a/gitops/Application_threescale-dev.yaml b/gitops/Application_threescale-dev.yaml new file mode 100644 index 0000000..f177ef1 --- /dev/null +++ b/gitops/Application_threescale-dev.yaml @@ -0,0 +1,16 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: threescale-dev +spec: + destination: + namespace: 3scale-dev + server: https://kubernetes.default.svc + project: default + source: + path: 3scale/overlays/dev + repoURL: https://gitlab.consulting.redhat.com/jugar_zone/3scale-gitops.git + targetRevision: HEAD + syncPolicy: + syncOptions: + - ApplyOutOfSyncOnly=true diff --git a/rbac/ClusterRole_gitops-threescale-access.yaml b/rbac/ClusterRole_gitops-threescale-access.yaml new file mode 100644 index 0000000..5ef5fcc --- /dev/null +++ b/rbac/ClusterRole_gitops-threescale-access.yaml @@ -0,0 +1,13 @@ +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: gitops-threescale-access + labels: + app.kubernetes.io/part-of: openshift-gitops +rules: +- apiGroups: [""] + resources: ["pods", "pods/log"] + verbs: ["get","list", "watch"] +- apiGroups: ["capabilities.3scale.net"] + resources: ["activedocs", "backends", "custompolicydefinitions","developeraccounts", "developerusers", "openapis", "products"] + verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]