Skip to content

Commit

Permalink
Adding suppor for params and certs
Browse files Browse the repository at this point in the history
  • Loading branch information
pubudu538 committed Apr 16, 2021
1 parent f06a756 commit cfae59c
Show file tree
Hide file tree
Showing 7 changed files with 342 additions and 37 deletions.
82 changes: 82 additions & 0 deletions api-operator/deploy/controller-configs/api_controller_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,88 @@ data:
# Deploy the API to API Manager
deployAPIToAPIManager: "false"

---

apiVersion: v1
kind: ConfigMap
metadata:
name: target-endpoint-controller-config
data:
#Required CPU usage pods can use for TargetEndPoint. Default-> resourceRequestMemory: "500m"
resourceRequestCPUTarget: "500m"
#Required Memory usage pods can use for TargetEndPoint. Default-> resourceRequestMemory: "512Mi"
resourceRequestMemoryTarget: "512Mi"
#Max CPU usage limit a pod can use for TargetEndPoint. Default-> resourceLimitCPU: "2000m"
resourceLimitCPUTarget: "500m"
#Max Memory usage limit a pod can use for TargetEndPoint. Default-> resourceLimitMemory: "512Mi"
resourceLimitMemoryTarget: "512Mi"

---

apiVersion: v1
kind: ConfigMap
metadata:
name: target-endpoint-hpa-config
data:
# Horizontal Pod Auto-Scaling for Micro-Gateways
# Maximum number of replicas for the Horizontal Pod Auto-scale. Default-> maxReplicas: "5"
mgwMaxReplicas: "5"
# Metrics configurations for v2beta2
mgwMetrics: |
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
# - type: Pods
# pods:
# metric:
# name: http_requests_total_value_per_second
# target:
# type: AverageValue
# averageValue: 100m
# - type: Object
# object:
# metric:
# name: requests-per-second
# describedObject:
# apiVersion: networking.k8s.io/v1beta1
# kind: Ingress
# name: main-route
# target:
# type: Value
# value: 10k
# Metrics Configurations for v2beta1
mgwMetricsV2beta1: |
- type: Resource
resource:
name: cpu
targetAverageUtilization: 50
# Horizontal Pod Auto-Scaling for Target-Endpoints
# Maximum number of replicas for the Horizontal Pod Auto-scale. Default-> maxReplicas: "5"
targetEndpointMaxReplicas: "5"
# Metrics configurations for v2beta2
targetEndpointMetrics: |
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
# Metrics Configurations for v2beta1
targetEndpointMetricsV2beta1: |
- type: Resource
resource:
name: cpu
targetAverageUtilization: 50
# HPA version. For custom metrics HPA version should be v2beta2. Default-> v2beta1
hpaVersion: "v2beta1"

---
apiVersion: v1
kind: Secret
Expand Down
2 changes: 2 additions & 0 deletions api-operator/pkg/apim/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const (
HeaderValueKeepAlive = "keep-alive"
HeaderValueXWWWFormUrlEncoded = "application/x-www-form-urlencoded"
DefaultHttpRequestTimeout = 10000
Deployment = "Deployment"
Certificates = "certificates"

publisherAPIImportEndpoint = "api/am/publisher/v2/apis/import?overwrite=true"
defaultClientRegistrationEndpointSuffix = "client-registration/v0.17/register"
Expand Down
Loading

0 comments on commit cfae59c

Please sign in to comment.