hanahmily commented on a change in pull request #12:
URL: https://github.com/apache/skywalking-swck/pull/12#discussion_r530160629



##########
File path: doc/custom-metrics-adapter.md
##########
@@ -0,0 +1,77 @@
+# Custom metrics Adapter
+
+This adapter contains an implementation of [external 
metrics](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/external-metrics-api.md)
+ API. It is therefore suitable for use with the autoscaling/v2 Horizontal Pod 
Autoscaler in Kubernetes 1.6+.
+ 
+
+## Use kustomize to customise your deployment
+
+1. Clone the source code:
+
+```sh
+git clone g...@github.com:apache/skywalking-swck.git
+```
+
+2. Edit file `config/adapter/adapter/kustomization.yaml` file to change your 
preferences. If you prefer to your private 
+ docker image, a quick path to override `ADAPTER_IMG` environment variable : 
`export ADAPTER_IMG=<private registry>/adapter:<tag>`
+
+3. Use `make` to generate the final manifests and deploy:
+
+```sh
+make adapter-deploy
+```
+
+## Configuration
+
+The adapter takes the standard Kubernetes generic API server arguments 
(including those for authentication and authorization). 
+By default, it will attempt to using Kubernetes in-cluster config to connect 
to the cluster.
+
+It takes the following addition arguments specific to configuring how the 
adapter talks to SkyWalking OAP cluster:
+
+ * `--oap-addr` The address of OAP cluster.
+ * `--metric-filter-regex` A regular expression to filter metrics retrieved 
from OAP cluster.
+ * `--refresh-interval` This is the interval at which to update the cache of 
available metrics from OAP cluster. 
+ 
+## HPA Configuration
+
+External metrics allow you to autoscale your cluster based on any metric 
available in OAP cluster. 
+ Just provide a metric block with a `name` and `selector`, and use the 
`External` metric type.
+ 
+```yaml
+- type: External
+  external:
+    metric:
+      name: <metric_name>
+      metricSelector:
+        matchLabels:
+          <label_key>: <label_value>
+          ...
+    target:
+      ....
+```
+
+ * metric_name: The name of metric generated by OAL or other subsystem.
+ * label: available `label_key`s are `service` and `label`. 
+  
+ The options of label keys are:
+ * `service` varies in different scopes. If the scope is `Service`, 
`ServiceInstance` and `Endpoint`, the `service` represents
+    `serviceName`, `serviceInstanceName` and `endpointName` respectively.

Review comment:
       > there is only a source release
   
   We release a binary package actually, 
https://dist.apache.org/repos/dist/release/skywalking/swck/0.1.0/. But it's 
used to build the release image. The binary can't be run outside kubernetes, 
that's the reason I didn't add a link to our website. In the next 
release/0.2.0, I will add adapter binary into it.
   
   The image release strategy is since binary release package contains 
`operator` and `adapter`, I will add them to a single image called 
`apache/skywalking-swck`. The default entry point of the image is `operator`, 
if uses want to run adapter, they should add `command: /bin/adapter` to the pod 
container node. 
   
   You might notice that there are two different images for the operator and 
adapter respectively. They are only for dev purposes. The docker file of the 
release version is going to be submitted soon.
   
    




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to