├── .github └── workflows │ ├── golang-ci.yml │ ├── helm-ci.yml │ └── linter.yml ├── CHANGELOG.md ├── DEVELOPMENT.md ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── api ├── client.go └── metrics.go ├── config.yaml ├── ct.yaml ├── deploy ├── .gitkeep └── helm │ ├── .helmignore │ ├── Chart.yaml │ ├── templates │ ├── _helpers.tpl │ ├── configmap.yaml │ ├── deployment.yaml │ ├── role.yaml │ ├── rolebindings.yaml │ └── serviceaccount.yaml │ └── values.yaml ├── go.mod ├── go.sum ├── logger └── logger.go ├── main.go ├── pkg └── k8s.go ├── scripts └── k8s-validation.sh ├── static ├── dynamic-pv-scaler-arch.png ├── dynamic-pv-scaler-logging.png ├── dynamic-pv-scaler.png └── dynamic-pv-scaler.svg └── utils ├── calculate.go └── yaml2json.go /.github/workflows/golang-ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Build Code Base 3 | 4 | on: [push, pull_request] 5 | 6 | jobs: 7 | build: 8 | name: build 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Setup Go 15 | uses: actions/setup-go@v2 16 | with: 17 | go-version: '1.14.0' 18 | 19 | - name: Building code 20 | run: | 21 | make get-depends 22 | make build-code 23 | 24 | - name: Set up QEMU 25 | uses: docker/setup-qemu-action@v1 26 | 27 | - name: Set up Docker Buildx 28 | uses: docker/setup-buildx-action@v1 29 | 30 | - name: Building Image 31 | uses: docker/build-push-action@v2 32 | with: 33 | context: . 34 | file: ./Dockerfile 35 | push: false 36 | tags: opstree/dynamic-pv-scaler:latest 37 | -------------------------------------------------------------------------------- /.github/workflows/helm-ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Lint and Test helm charts 3 | 4 | on: [push, pull_request] 5 | 6 | jobs: 7 | lint-test: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v2 12 | 13 | - name: Fetch history 14 | run: git fetch --prune --unshallow 15 | 16 | - name: Run chart-testing (lint) 17 | id: lint 18 | uses: helm/chart-testing-action@v1.0.0 19 | with: 20 | command: lint 21 | config: ct.yaml 22 | 23 | - name: Create kind cluster 24 | uses: helm/kind-action@v1.0.0 25 | # if: steps.lint.outputs.changed == 'true' 26 | 27 | - name: Run chart-testing (install) 28 | uses: helm/chart-testing-action@v1.0.0 29 | with: 30 | command: install 31 | config: ct.yaml 32 | -------------------------------------------------------------------------------- /.github/workflows/linter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Lint Code Base 3 | 4 | on: [push, pull_request] 5 | 6 | jobs: 7 | golangci: 8 | name: lint 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: golangci-lint 13 | uses: golangci/golangci-lint-action@v2 14 | with: 15 | version: v1.29 16 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### v0.0.1 (Initial Release) 2 | ##### February 21, 2020 3 | 4 | #### :tada: Features 5 | 6 | - JSON logging 7 | - Dockerization of application 8 | - `go.mod` for dependency management 9 | - Added apache2 LICENSE 10 | - Yaml configuration for management 11 | -------------------------------------------------------------------------------- /DEVELOPMENT.md: -------------------------------------------------------------------------------- 1 | ### Development 2 | 3 | #### Pre-requisites 4 | 5 | First of all, you need access on a Kubernetes cluster. The other dependencies are:- 6 | 7 | - **[Kubernetes](https://kubernetes.io/)** 8 | - **[Prometheus](https://prometheus.io/)** 9 | - **[Golang](https://golang.org/)** 10 | 11 | In storageclass, *allowVolumeExpansion* flag should be `true` 12 | 13 | Example:- 14 | 15 | ```yaml 16 | --- 17 | apiVersion: storage.k8s.io/v1 18 | kind: StorageClass 19 | metadata: 20 | name: standard 21 | provisioner: kubernetes.io/aws-ebs 22 | parameters: 23 | type: gp2 24 | reclaimPolicy: Retain 25 | allowVolumeExpansion: true # This should be true for every storage class 26 | mountOptions: 27 | - debug 28 | volumeBindingMode: Immediate 29 | ``` 30 | 31 | #### Code Directories Overview 32 | 33 | ```s 34 | dynamic-pv-scaler 35 | ├── api ---> API machinery for k8s client and prometheus client 36 | ├── deploy ---> Deployment related files, for deployment on k8s 37 | │   └── helm ---> Fully functional helm chart 38 | │   └── templates ---> Helm templates 39 | ├── logger ---> JSON logger interface for logging 40 | ├── pkg ---> K8s related operations like pv resizing, pod deletion 41 | ├── static ---> Static images for documentation 42 | └── utils ---> Utilities which are being used in codebase like yaml to json conversion 43 | ``` 44 | 45 | #### Building Code 46 | 47 | For building the code, execute `make` steps:- 48 | 49 | ```shell 50 | # For building the code 51 | make build-code 52 | 53 | # For building the image 54 | make build-image 55 | ``` 56 | 57 | #### Checking Code Formatting 58 | 59 | ```shell 60 | make check-fmt 61 | make lint 62 | ``` 63 | 64 | #### Testing the Code 65 | 66 | ```shell 67 | make test 68 | ``` -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:latest as builder 2 | MAINTAINER OpsTree Solutions 3 | COPY ./ /go/src/dynamic-pv-scaling/ 4 | WORKDIR /go/src/dynamic-pv-scaling/ 5 | RUN go get -v -t -d ./... \ 6 | && go build -o dynamic-pv-scaler 7 | 8 | FROM alpine:latest 9 | MAINTAINER OpsTree Solutions 10 | WORKDIR /app 11 | RUN apk add --no-cache libc6-compat 12 | COPY --from=builder /go/src/dynamic-pv-scaling/dynamic-pv-scaler /app/ 13 | ENTRYPOINT ["./dynamic-pv-scaler"] 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Image URL to use all building/pushing image targets 2 | REGISTRY ?= quay.io 3 | REPOSITORY ?= $(REGISTRY)/opstree 4 | 5 | get-depends: 6 | go get -v ./... 7 | 8 | build-code: get-depends 9 | go build -o dynamic-pv-scaler 10 | 11 | build-image: 12 | docker build -t quay.io/opstree/dynamic-pv-scaler:latest -f Dockerfile . 13 | 14 | check-fmt: 15 | test -z "$(shell gofmt -l .)" 16 | 17 | lint: 18 | OUTPUT="$(shell go list ./...)"; golint -set_exit_status $$OUTPUT 19 | 20 | vet: 21 | VET_OUTPUT="$(shell go list ./...)"; GO111MODULE=on go vet $$VET_OUTPUT 22 | 23 | test: 24 | go test -v -coverprofile=coverage.txt ./... 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | [![GitHub Super-Linter](https://github.com/opstree/dynamic-pv-scaler/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/opstree/dynamic-pv-scaler) 6 | [![Go Report Card](https://goreportcard.com/badge/github.com/opstree/dynamic-pv-scaler)](https://goreportcard.com/report/github.com/opstree/dynamic-pv-scaler) 7 | [![Maintainability](https://api.codeclimate.com/v1/badges/e60ff968a326babe871f/maintainability)](https://codeclimate.com/github/opstree/dynamic-pv-scaler/maintainability) 8 | [![Docker Repository on Quay](https://img.shields.io/badge/container-ready-green "Docker Repository on Quay")](https://quay.io/repository/opstree/dynamic-pv-scaler) 9 | [![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) 10 | ![GitHub release (latest by date)](https://img.shields.io/github/v/release/opstree/dynamic-pv-scaler) 11 | 12 | ## Volume Booster 13 | 14 | A golang based Kubernetes application which has been created to overcome the scaling issue of Persistent Volume in Kubernetes. This can scale the Persistent Volume on the basis of threshold which you have set. 15 | 16 | ## Getting Started 17 | 18 | ### Architecture 19 | 20 |

21 | 22 |

23 | 24 | ### Pre-requisites 25 | 26 | Sorry none of these pre-requisites can be compromised. So you guys have to meet these requirements :slightly_smiling_face: 27 | 28 | - Kubernetes cluster version should be greater than 1.11+ 29 | - Prometheus should be have the information of Persistent Volume 30 | - In storageclass, *allowVolumeExpansion* flag should be `true` 31 | 32 | Example:- 33 | 34 | ```yaml 35 | --- 36 | apiVersion: storage.k8s.io/v1 37 | kind: StorageClass 38 | metadata: 39 | name: standard 40 | provisioner: kubernetes.io/aws-ebs 41 | parameters: 42 | type: gp2 43 | reclaimPolicy: Retain 44 | allowVolumeExpansion: true # This should be true for every storage class 45 | mountOptions: 46 | - debug 47 | volumeBindingMode: Immediate 48 | ``` 49 | 50 | That's it 51 | 52 | ### Configuration 53 | 54 | We are using helm to maintain the deployment and release in Kubernetes cluster. [Hit Me](./deploy/helm). But for configuration part this application accepts a yaml file `.config.yaml`: 55 | 56 | ```yaml 57 | --- 58 | - namespace: database 59 | scale_percentage: 50 60 | threshold_percentage: 80 61 | pvc_name: data-mysql-0 62 | ``` 63 | 64 | Configuration file overview:- 65 | 66 | | **Field** | **Default Value** | **Possible Values** | **Description** | 67 | |-----------|-------------------|---------------------|-----------------| 68 | | namespace | - | *Any valid k8s namespace* | Persistent Volume's namespace which needs to be watched | 69 | | scale_percentage | - | *Any integer* | How much percent you want to scale your pv | 70 | | threshold_percentage | - | *Any integer* | The target percentage after which you want to scale the pv | 71 | | pvc_name | - | *Any valid k8s pvc name* | Name of the pvc which you want to scale | 72 | 73 | Make sure you have updated the configuration in [values.yaml](./deploy/helm/values.yaml). 74 | 75 | ### Installation 76 | 77 | Simply use the helm chart to install it on your flavor of Kubernetes. 78 | 79 | ```shell 80 | # Deploy the PV Scaler 81 | helm upgrade dynamic-pv-scaler ./deploy/helm --install --namespace dynamic-pv-scaler 82 | ``` 83 | 84 | Verify the installation 85 | 86 | ```shell 87 | helm test dynamic-pv-scaler --namespace dynamic-pv-scaler 88 | kubectl get pods -n dynamic-pv-scaler 89 | ``` 90 | 91 | ### Logging 92 | 93 | The application's logging interface is designed to print logs in JSON stdout. Example logs:- 94 | 95 | ![](./static/dynamic-pv-scaler-logging.png) 96 | 97 | ## Development 98 | 99 | Please see our [development documentation](./DEVELOPMENT.md) for details. 100 | 101 | ## Release 102 | 103 | Please see our [release documentation](./CHANGELOG.md) for details. 104 | 105 | ## Contact 106 | 107 | If you have any suggestion or query. Contact us at 108 | 109 | opensource@opstree.com 110 | -------------------------------------------------------------------------------- /api/client.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "dynamic-pv-scaling/logger" 5 | log "github.com/sirupsen/logrus" 6 | "k8s.io/client-go/kubernetes" 7 | "k8s.io/client-go/rest" 8 | ) 9 | 10 | const ( 11 | kubeConfig = "InClusterConfig" 12 | ) 13 | 14 | // CreateClient function returns are kubernetes client 15 | func CreateClient() *kubernetes.Clientset { 16 | config, err := rest.InClusterConfig() 17 | logger.LogStdout() 18 | 19 | if err != nil { 20 | log.WithFields(log.Fields{ 21 | "kubeconfig": kubeConfig, 22 | }).Error(err.Error()) 23 | } 24 | 25 | log.WithFields(log.Fields{ 26 | "kubeconfig": kubeConfig, 27 | }).Info("Successfully authenticated with K8s cluster") 28 | 29 | clientset, err := kubernetes.NewForConfig(config) 30 | 31 | if err != nil { 32 | log.WithFields(log.Fields{ 33 | "kubeconfig": kubeConfig, 34 | }).Error(err.Error()) 35 | } 36 | 37 | log.WithFields(log.Fields{ 38 | "kubeconfig": kubeConfig, 39 | }).Info("Successfully created the K8s client") 40 | 41 | return clientset 42 | } 43 | -------------------------------------------------------------------------------- /api/metrics.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "encoding/json" 5 | "io/ioutil" 6 | "net/http" 7 | "os" 8 | "strconv" 9 | "strings" 10 | 11 | "dynamic-pv-scaling/logger" 12 | log "github.com/sirupsen/logrus" 13 | ) 14 | 15 | var ( 16 | prometheusURL string 17 | ) 18 | 19 | // JSONResponse is a struct for json with the below mentioned keys 20 | type JSONResponse struct { 21 | Status string `json:"status"` 22 | Data struct { 23 | ResultType string `json:"resultType"` 24 | Result []struct { 25 | Metric struct { 26 | Endpoint string `json:"endpoint"` 27 | Instance string `json:"instance"` 28 | Job string `json:"job"` 29 | Namespace string `json:"namespace"` 30 | Node string `json:"node"` 31 | Persistentvolumeclaim string `json:"persistentvolumeclaim"` 32 | Service string `json:"service"` 33 | } `json:"metric"` 34 | Value []string `json:"value"` 35 | } `json:"result"` 36 | } `json:"data"` 37 | } 38 | 39 | // PersistentVolumeList is a struct for json with the below mentioned keys 40 | type PersistentVolumeList struct { 41 | PeristentVolumeName string `json:"persistent_volume_name"` 42 | Namespace string `json:"namespace"` 43 | Value int `json:"value"` 44 | } 45 | 46 | // PersistentVolumeUsage struct for a json with below mentioned keys 47 | type PersistentVolumeUsage struct { 48 | PeristentVolumeName string `json:"persistent_volume_name"` 49 | Namespace string `json:"namespace"` 50 | Value int `json:"value"` 51 | } 52 | 53 | // GetPersistentVolumeList takes namespace and PV name as input and returns persistent volume list */ 54 | func GetPersistentVolumeList(nameSpace string, persistentVolumeName string) PersistentVolumeList { 55 | var qeuryResponse JSONResponse 56 | var pvList PersistentVolumeList 57 | logger.LogStdout() 58 | 59 | resp := GetVolumeListQueryResponse(nameSpace, persistentVolumeName) 60 | output, err := ioutil.ReadAll(resp.Body) 61 | if err != nil { 62 | log.WithFields(log.Fields{ 63 | "kubeconfig": kubeConfig, 64 | "namespace": nameSpace, 65 | "persistent_volume": persistentVolumeName, 66 | }).Error(err) 67 | } 68 | 69 | err = json.Unmarshal(output, &qeuryResponse) 70 | 71 | if err != nil { 72 | log.WithFields(log.Fields{ 73 | "kubeconfig": kubeConfig, 74 | "namespace": nameSpace, 75 | "persistent_volume": persistentVolumeName, 76 | }).Error(err) 77 | } 78 | 79 | for _, queryOutput := range qeuryResponse.Data.Result { 80 | finalValue, _ := strconv.ParseFloat(strings.Join(queryOutput.Value, ""), 64) 81 | pvLists := PersistentVolumeList{ 82 | PeristentVolumeName: queryOutput.Metric.Persistentvolumeclaim, 83 | Namespace: queryOutput.Metric.Namespace, 84 | Value: int(finalValue), 85 | } 86 | pvList = pvLists 87 | } 88 | return pvList 89 | } 90 | 91 | // GetPeristentVolumeUsage takes namespace and PV name as input and return persistent volume usage */ 92 | func GetPeristentVolumeUsage(nameSpace string, persistentVolumeName string) PersistentVolumeUsage { 93 | var qeuryResponse JSONResponse 94 | var pvList PersistentVolumeUsage 95 | logger.LogStdout() 96 | 97 | resp := GetVolumeUsageQueryResponse(nameSpace, persistentVolumeName) 98 | output, err := ioutil.ReadAll(resp.Body) 99 | 100 | if err != nil { 101 | log.WithFields(log.Fields{ 102 | "kubeconfig": kubeConfig, 103 | "namespace": nameSpace, 104 | "persistent_volume_name": persistentVolumeName, 105 | }).Error(err) 106 | } 107 | 108 | err = json.Unmarshal(output, &qeuryResponse) 109 | 110 | if err != nil { 111 | log.WithFields(log.Fields{ 112 | "kubeconfig": kubeConfig, 113 | "namespace": nameSpace, 114 | "persistent_volume": persistentVolumeName, 115 | }).Error(err) 116 | } 117 | 118 | for _, queryOutput := range qeuryResponse.Data.Result { 119 | finalValue, _ := strconv.Atoi(strings.Join(queryOutput.Value, "")) 120 | gbValue := finalValue/1024/1024/1024 + 1 121 | pvLists := PersistentVolumeUsage{ 122 | PeristentVolumeName: queryOutput.Metric.Persistentvolumeclaim, 123 | Namespace: queryOutput.Metric.Namespace, 124 | Value: gbValue, 125 | } 126 | pvList = pvLists 127 | } 128 | return pvList 129 | } 130 | 131 | // GetVolumeListQueryResponse function takes namespace and PV volume name as input and returns list of volumes via prometheus */ 132 | func GetVolumeListQueryResponse(nameSpace string, persistentVolumeName string) *http.Response { 133 | logger.LogStdout() 134 | 135 | req := GenerateVolumeListQuery(nameSpace, persistentVolumeName) 136 | resp, err := http.DefaultClient.Do(req) 137 | 138 | if err != nil { 139 | log.WithFields(log.Fields{ 140 | "kubeconfig": kubeConfig, 141 | "namespace": nameSpace, 142 | "persistent_volume": persistentVolumeName, 143 | }).Error(err) 144 | } 145 | 146 | log.WithFields(log.Fields{ 147 | "kubeconfig": kubeConfig, 148 | "namespace": nameSpace, 149 | "persistent_volume": persistentVolumeName, 150 | }).Info("Successfully connected with prometheus at " + prometheusURL + " to list persistent volume") 151 | 152 | return resp 153 | } 154 | 155 | // GetVolumeUsageQueryResponse function takes namespace and PV volume name as input and returns Volume Usage via prometheus */ 156 | func GetVolumeUsageQueryResponse(nameSpace string, persistentVolumeName string) *http.Response { 157 | logger.LogStdout() 158 | 159 | req := GenerateVolumeUsageQuery(nameSpace, persistentVolumeName) 160 | resp, err := http.DefaultClient.Do(req) 161 | 162 | if err != nil { 163 | log.WithFields(log.Fields{ 164 | "kubeconfig": kubeConfig, 165 | "namespace": nameSpace, 166 | "persistent_volume": persistentVolumeName, 167 | }).Error(err) 168 | } 169 | 170 | log.WithFields(log.Fields{ 171 | "kubeconfig": kubeConfig, 172 | "namespace": nameSpace, 173 | "persistent_volume": persistentVolumeName, 174 | }).Info("Successfully connected with prometheus at " + prometheusURL + " to get persistent volume usage") 175 | 176 | return resp 177 | } 178 | 179 | // GenerateVolumeListQuery function generates the query to extract volume list from prometheus and returns the same 180 | func GenerateVolumeListQuery(nameSpace string, persistentVolumeName string) *http.Request { 181 | logger.LogStdout() 182 | prometheusURL = os.Getenv("PROMETHEUS_URL") + "/api/v1/query" 183 | 184 | body := strings.NewReader(`query=100 * (kubelet_volume_stats_available_bytes{namespace="` + nameSpace + `",persistentvolumeclaim="` + persistentVolumeName + `"} / kubelet_volume_stats_capacity_bytes{namespace="` + nameSpace + `",persistentvolumeclaim="` + persistentVolumeName + `"})`) 185 | req, err := http.NewRequest("POST", prometheusURL, body) 186 | 187 | if err != nil { 188 | log.WithFields(log.Fields{ 189 | "kubeconfig": kubeConfig, 190 | "namespace": nameSpace, 191 | "persistent_volume": persistentVolumeName, 192 | }).Error(err) 193 | } 194 | 195 | log.WithFields(log.Fields{ 196 | "kubeconfig": kubeConfig, 197 | "namespace": nameSpace, 198 | "persistent_volume": persistentVolumeName, 199 | }).Info("Successfully created the query for prometheus to list persistent volumes") 200 | req.Header.Set("Content-Type", "application/x-www-form-urlencoded") 201 | req.SetBasicAuth("sky", "sky") 202 | return req 203 | } 204 | 205 | // GenerateVolumeUsageQuery function generates the volume usage query to extract usage info from prometheus 206 | func GenerateVolumeUsageQuery(nameSpace string, persistentVolumeName string) *http.Request { 207 | logger.LogStdout() 208 | prometheusURL = os.Getenv("PROMETHEUS_URL") + "/api/v1/query" 209 | 210 | body := strings.NewReader(`query=kubelet_volume_stats_capacity_bytes{namespace="` + nameSpace + `",persistentvolumeclaim="` + persistentVolumeName + `"}`) 211 | req, err := http.NewRequest("POST", prometheusURL, body) 212 | 213 | if err != nil { 214 | log.WithFields(log.Fields{ 215 | "kubeconfig": kubeConfig, 216 | "namespace": nameSpace, 217 | "persistent_volume": persistentVolumeName, 218 | }).Error(err) 219 | } 220 | 221 | log.WithFields(log.Fields{ 222 | "kubeconfig": kubeConfig, 223 | "namespace": nameSpace, 224 | "persistent_volume": persistentVolumeName, 225 | }).Info("Successfully created the query for prometheus to check volume usage") 226 | req.Header.Set("Content-Type", "application/x-www-form-urlencoded") 227 | return req 228 | } 229 | -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | - namespace: database 3 | scale_percentage: 50 4 | threshold_percentage: 80 5 | pvc_name: data-mysql-0 6 | -------------------------------------------------------------------------------- /ct.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | remote: origin 3 | target-branch: master 4 | chart-dirs: 5 | - deploy/helm 6 | helm-extra-args: --timeout 600s 7 | -------------------------------------------------------------------------------- /deploy/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opstree/dynamic-pv-scaler/dc9ca9cae5e5eda7382fe96ef86e6c78f6b4a734/deploy/.gitkeep -------------------------------------------------------------------------------- /deploy/helm/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | .vscode/ 23 | -------------------------------------------------------------------------------- /deploy/helm/Chart.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | appVersion: "v0.1.0" 4 | description: A golang based Kubernetes application which has been created to overcome the scaling issue of Persistent Volume in Kubernetes. 5 | engine: gotpl 6 | name: dynamic-pv-scaler 7 | version: 0.1.0 8 | home: https://github.com/opstree/dynamic-pv-scaler 9 | maintainers: 10 | - email: abhishekbhardwaj510@gmail.com 11 | name: iamabhishek-dubey 12 | - email: sandeep@opstree.com 13 | name: sandy724 14 | sources: 15 | - https://github.com/opstree/dynamic-pv-scaler 16 | keywords: 17 | - kubernetes 18 | - prometheus 19 | - persistent-volume 20 | - openshift 21 | icon: https://github.com/opstree/dynamic-pv-scaler/raw/master/static/dynamic-pv-scaler.svg 22 | -------------------------------------------------------------------------------- /deploy/helm/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "dynamic-pv-scaler.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "dynamic-pv-scaler.fullname" -}} 15 | {{- if .Values.fullnameOverride -}} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 17 | {{- else -}} 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} 19 | {{- if contains $name .Release.Name -}} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 21 | {{- else -}} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{/* 28 | Create chart name and version as used by the chart label. 29 | */}} 30 | {{- define "dynamic-pv-scaler.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 32 | {{- end -}} 33 | 34 | {{/* 35 | Create the name of the service account to use 36 | */}} 37 | {{- define "dynamic-pv-scaler.serviceAccountName" -}} 38 | {{- if .Values.serviceAccount.create -}} 39 | {{ default (include "dynamic-pv-scaler.fullname" .) .Values.serviceAccount.name }} 40 | {{- else -}} 41 | {{ default "default" .Values.serviceAccount.name }} 42 | {{- end -}} 43 | {{- end -}} 44 | -------------------------------------------------------------------------------- /deploy/helm/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ include "dynamic-pv-scaler.fullname" . }} 5 | labels: 6 | app.kubernetes.io/name: {{ include "dynamic-pv-scaler.fullname" . }} 7 | helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 8 | app.kubernetes.io/managed-by: {{ .Release.Service }} 9 | app.kubernetes.io/instance: {{ .Release.Name }} 10 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 11 | data: 12 | {{- range $key, $value := .Values.configMaps }} 13 | {{ $key }}: |- 14 | {{ $value | indent 4 }} 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /deploy/helm/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: {{ include "dynamic-pv-scaler.fullname" . }} 6 | labels: 7 | app.kubernetes.io/name: {{ include "dynamic-pv-scaler.fullname" . }} 8 | helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 9 | app.kubernetes.io/managed-by: {{ .Release.Service }} 10 | app.kubernetes.io/instance: {{ .Release.Name }} 11 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 12 | annotations: 13 | {{- toYaml .Values.annotations | nindent 4 }} 14 | spec: 15 | replicas: {{ .Values.replicas }} 16 | selector: 17 | matchLabels: 18 | app.kubernetes.io/name: {{ include "dynamic-pv-scaler.fullname" . }} 19 | app.kubernetes.io/instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app.kubernetes.io/name: {{ include "dynamic-pv-scaler.fullname" . }} 24 | app.kubernetes.io/instance: {{ .Release.Name }} 25 | spec: 26 | containers: 27 | - name: {{ include "dynamic-pv-scaler.fullname" . }} 28 | image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" 29 | imagePullPolicy: {{ .Values.image.imagePullPolicy }} 30 | env: 31 | - name: PROMETHEUS_URL 32 | value: {{ .Values.prometheus.url }} 33 | - name: CONFIG_FILE 34 | value: "/etc/opstree.conf.d/config.yaml" 35 | volumeMounts: 36 | - mountPath: /etc/opstree.conf.d/config.yaml 37 | name: {{ include "dynamic-pv-scaler.fullname" . }}-config 38 | subPath: config.yaml 39 | volumes: 40 | - name: {{ include "dynamic-pv-scaler.fullname" . }}-config 41 | configMap: 42 | name: {{ include "dynamic-pv-scaler.fullname" . }}-config 43 | {{- if .Values.serviceAccount.create }} 44 | serviceAccount: {{ include "dynamic-pv-scaler.fullname" . }} 45 | serviceAccountName: {{ include "dynamic-pv-scaler.fullname" . }} 46 | {{- end }} 47 | -------------------------------------------------------------------------------- /deploy/helm/templates/role.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: ClusterRole 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: {{ include "dynamic-pv-scaler.fullname" . }} 6 | labels: 7 | app.kubernetes.io/name: {{ include "dynamic-pv-scaler.fullname" . }} 8 | helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 9 | app.kubernetes.io/managed-by: {{ .Release.Service }} 10 | app.kubernetes.io/instance: {{ .Release.Name }} 11 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 12 | rules: 13 | - apiGroups: [""] 14 | resources: ["pods", "persistentvolumeclaim"] 15 | verbs: ["get", "watch", "list", "delete", "create", "update"] 16 | -------------------------------------------------------------------------------- /deploy/helm/templates/rolebindings.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRoleBinding 4 | metadata: 5 | name: {{ include "dynamic-pv-scaler.fullname" . }} 6 | labels: 7 | app.kubernetes.io/name: {{ include "dynamic-pv-scaler.fullname" . }} 8 | helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 9 | app.kubernetes.io/managed-by: {{ .Release.Service }} 10 | app.kubernetes.io/instance: {{ .Release.Name }} 11 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 12 | subjects: 13 | - kind: ServiceAccount 14 | name: {{ include "dynamic-pv-scaler.fullname" . }} 15 | namespace: {{ .Release.Namespace }} 16 | roleRef: 17 | kind: ClusterRole 18 | name: {{ include "dynamic-pv-scaler.fullname" . }} 19 | apiGroup: rbac.authorization.k8s.io 20 | -------------------------------------------------------------------------------- /deploy/helm/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | --- 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: {{ include "dynamic-pv-scaler.fullname" . }} 7 | labels: 8 | app.kubernetes.io/name: {{ include "dynamic-pv-scaler.fullname" . }} 9 | helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 10 | app.kubernetes.io/managed-by: {{ .Release.Service }} 11 | app.kubernetes.io/instance: {{ .Release.Name }} 12 | app.kubernetes.io/version: {{ .Chart.AppVersion }} 13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /deploy/helm/values.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | image: 3 | name: quay.io/opstree/dynamic-pv-scaler 4 | tag: latest 5 | imagePullPolicy: IfNotPresent 6 | 7 | prometheus: 8 | url: http://prometheus.opstree.com 9 | 10 | configMaps: 11 | config.yaml: | 12 | --- 13 | - namespace: test123 14 | scale_percentage: 50 15 | threshold_percentage: 80 16 | pvc_name: data-mysql-0 17 | 18 | serviceAccount: 19 | create: true 20 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module dynamic-pv-scaling 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4 7 | github.com/imdario/mergo v0.3.8 // indirect 8 | github.com/jasonlvhit/gocron v0.0.0-20191228163020-98b59b546dee 9 | github.com/kubernetes-incubator/custom-metrics-apiserver v0.0.0-20191121125929-03554330a964 // indirect 10 | github.com/sirupsen/logrus v1.4.2 11 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect 12 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect 13 | k8s.io/api v0.17.3 14 | k8s.io/apimachinery v0.17.3 15 | k8s.io/client-go v0.17.0 16 | k8s.io/utils v0.0.0-20200124190032-861946025e34 // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 4 | github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= 5 | github.com/Azure/go-autorest v11.1.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= 6 | github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= 7 | github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= 8 | github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= 9 | github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= 10 | github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= 11 | github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= 12 | github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= 13 | github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 14 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 15 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 16 | github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= 17 | github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 18 | github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 19 | github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= 20 | github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= 21 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 22 | github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= 23 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 24 | github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= 25 | github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 26 | github.com/coreos/go-oidc v0.0.0-20180117170138-065b426bd416/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= 27 | github.com/coreos/go-semver v0.0.0-20180108230905-e214231b295a/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 28 | github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 29 | github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 30 | github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 31 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 32 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 33 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 34 | github.com/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 35 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 36 | github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= 37 | github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= 38 | github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= 39 | github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= 40 | github.com/emicklei/go-restful v2.2.1+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= 41 | github.com/emicklei/go-restful-swagger12 v0.0.0-20170208215640-dcef7f557305/go.mod h1:qr0VowGBT4CS4Q8vFF8BSeKz34PuqKGxs/L0IAQA9DQ= 42 | github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 43 | github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 44 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 45 | github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680 h1:ZktWZesgun21uEDrwW7iEV1zPCGQldM2atlJZ3TdvVM= 46 | github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 47 | github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4 h1:bRzFpEzvausOAt4va+I/22BZ1vXDtERngp0BNYDKej0= 48 | github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 49 | github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= 50 | github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= 51 | github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= 52 | github.com/go-openapi/jsonpointer v0.19.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= 53 | github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= 54 | github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= 55 | github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= 56 | github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= 57 | github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= 58 | github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= 59 | github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= 60 | github.com/go-openapi/swag v0.17.2/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= 61 | github.com/go-redis/redis v6.15.5+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= 62 | github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 63 | github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= 64 | github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= 65 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 66 | github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 67 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 68 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 69 | github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 70 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 71 | github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= 72 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 73 | github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 74 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 75 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 76 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 77 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 78 | github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= 79 | github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= 80 | github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= 81 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 82 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 83 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 84 | github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 85 | github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 86 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 87 | github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= 88 | github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= 89 | github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= 90 | github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= 91 | github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= 92 | github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= 93 | github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= 94 | github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 95 | github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20170330212424-2500245aa611/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= 96 | github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= 97 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 98 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 99 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 100 | github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= 101 | github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= 102 | github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= 103 | github.com/jasonlvhit/gocron v0.0.0-20191228163020-98b59b546dee h1:vIYpscVc1753m7svyoDldyaEi2MDa7808yh3hMXVZjg= 104 | github.com/jasonlvhit/gocron v0.0.0-20191228163020-98b59b546dee/go.mod h1:1nXLkt6gXojCECs34KL3+LlZ3gTpZlkPUA8ejW3WeP0= 105 | github.com/jonboulle/clockwork v0.0.0-20141017032234-72f9bd7c4e0c/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= 106 | github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 107 | github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 108 | github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= 109 | github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 110 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 111 | github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 112 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 113 | github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= 114 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 115 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 116 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 117 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 118 | github.com/kubernetes-incubator/custom-metrics-apiserver v0.0.0-20190918110929-3d9be26a50eb/go.mod h1:KWRxWvzVCNvDtG9ejU5UdpgvxdCZFMUZu0xroKWG8Bo= 119 | github.com/kubernetes-incubator/custom-metrics-apiserver v0.0.0-20191121125929-03554330a964 h1:dqeSyDKjR4sMZpP8wNMCfg2D946Khk/1rquJYaaRg1s= 120 | github.com/kubernetes-incubator/custom-metrics-apiserver v0.0.0-20191121125929-03554330a964/go.mod h1:eNFfeBnf729t6xpnDfzzfNdDoZIDX53VT3EYnt87rGk= 121 | github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 122 | github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 123 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 124 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 125 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 126 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 127 | github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 128 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 129 | github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= 130 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 131 | github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= 132 | github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= 133 | github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= 134 | github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 135 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 136 | github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 137 | github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= 138 | github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 139 | github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 140 | github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= 141 | github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= 142 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 143 | github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 144 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 145 | github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= 146 | github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= 147 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 148 | github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 149 | github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 150 | github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= 151 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 152 | github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= 153 | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 154 | github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= 155 | github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= 156 | github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 157 | github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 158 | github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= 159 | github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 160 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 161 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 162 | github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 163 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 164 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 165 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 166 | github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 167 | github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 168 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 169 | go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 170 | go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 171 | go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 172 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 173 | golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 174 | golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 175 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= 176 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 177 | golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= 178 | golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 179 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 180 | golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 181 | golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 182 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 183 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 184 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 185 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 186 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 187 | golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 188 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 189 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 190 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 191 | golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 192 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 193 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 194 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 195 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 196 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 197 | golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 198 | golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= 199 | golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 200 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 201 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 202 | golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 203 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 204 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= 205 | golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 206 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 207 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 208 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 209 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 210 | golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 211 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 212 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 213 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 214 | golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 215 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 216 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 217 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 218 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 219 | golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 h1:ng0gs1AKnRRuEMZoTLLlbOd+C17zUDepwGQBb/n+JVg= 220 | golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 221 | golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 222 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 223 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 224 | golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 225 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= 226 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 227 | golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 228 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 229 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 230 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= 231 | golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 232 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 233 | golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 234 | golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 235 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 236 | golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 237 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 238 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 239 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 240 | golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 241 | gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= 242 | gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= 243 | gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= 244 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 245 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 246 | google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= 247 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 248 | google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= 249 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 250 | google.golang.org/genproto v0.0.0-20170731182057-09f6ed296fc6/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 251 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 252 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 253 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 254 | google.golang.org/grpc v1.13.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= 255 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 256 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 257 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 258 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 259 | gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= 260 | gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= 261 | gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= 262 | gopkg.in/natefinch/lumberjack.v2 v2.0.0-20150622162204-20b71e5b60d7/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= 263 | gopkg.in/square/go-jose.v2 v2.0.0-20180411045311-89060dee6a84/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= 264 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 265 | gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= 266 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 267 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 268 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 269 | gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= 270 | gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 271 | gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= 272 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 273 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 274 | k8s.io/api v0.0.0-20190817021128-e14a4b1f5f84/go.mod h1:AOxZTnaXR/xiarlQL0JUfwQPxjmKDvVYoRp58cA7lUo= 275 | k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= 276 | k8s.io/api v0.17.3 h1:XAm3PZp3wnEdzekNkcmj/9Y1zdmQYJ1I4GKSBBZ8aG0= 277 | k8s.io/api v0.17.3/go.mod h1:YZ0OTkuw7ipbe305fMpIdf3GLXZKRigjtZaV5gzC2J0= 278 | k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d/go.mod h1:3jediapYqJ2w1BFw7lAZPCx7scubsTfosqHkhXCWJKw= 279 | k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= 280 | k8s.io/apimachinery v0.17.3 h1:f+uZV6rm4/tHE7xXgLyToprg6xWairaClGVkm2t8omg= 281 | k8s.io/apimachinery v0.17.3/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g= 282 | k8s.io/apiserver v0.0.0-20190817022445-fd6150da8f40/go.mod h1:y8ZdhfMfrk2yoL/NSdeWl5dAfrXIbRQy8jqP/R7s41k= 283 | k8s.io/client-go v0.0.0-20190817021527-637fc595d17a/go.mod h1:+Ns9AwGRd5TqhqhXZkLSCzO/bpUSWwP93/TE0q2OsLQ= 284 | k8s.io/client-go v0.17.0 h1:8QOGvUGdqDMFrm9sD6IUFl256BcffynGoe80sxgTEDg= 285 | k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= 286 | k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= 287 | k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= 288 | k8s.io/code-generator v0.0.0-20190612205613-18da4a14b22b/go.mod h1:G8bQwmHm2eafm5bgtX67XDZQ8CWKSGu9DekI+yN4Y5I= 289 | k8s.io/component-base v0.0.0-20190817022002-dd0e01d5790f/go.mod h1:DFWQCXgXVLiWtzFaS17KxHdlUeUymP7FLxZSkmL9/jU= 290 | k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= 291 | k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= 292 | k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 293 | k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 294 | k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 295 | k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= 296 | k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= 297 | k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= 298 | k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= 299 | k8s.io/metrics v0.0.0-20190817023635-63ee757b2e8b/go.mod h1:Bq04mDjH+zC+wFQK5nkGA/JRJvGmIGXG2svEbV3FNi4= 300 | k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= 301 | k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= 302 | k8s.io/utils v0.0.0-20200124190032-861946025e34 h1:HjlUD6M0K3P8nRXmr2B9o4F9dUy9TCj/aEpReeyi6+k= 303 | k8s.io/utils v0.0.0-20200124190032-861946025e34/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= 304 | modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= 305 | modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= 306 | modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= 307 | modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= 308 | modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= 309 | sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= 310 | sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= 311 | sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= 312 | sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= 313 | -------------------------------------------------------------------------------- /logger/logger.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | import ( 4 | log "github.com/sirupsen/logrus" 5 | "io" 6 | "os" 7 | ) 8 | 9 | // LogStdout function prints the timestamp for logging purposes 10 | func LogStdout() { 11 | log.SetFormatter(&log.JSONFormatter{ 12 | TimestampFormat: "02-01-2006 15:04:05", 13 | }) 14 | mw := io.MultiWriter(os.Stdout) 15 | log.SetOutput(mw) 16 | } 17 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "dynamic-pv-scaling/api" 5 | "dynamic-pv-scaling/logger" 6 | "dynamic-pv-scaling/pkg" 7 | "dynamic-pv-scaling/utils" 8 | "fmt" 9 | "github.com/jasonlvhit/gocron" 10 | log "github.com/sirupsen/logrus" 11 | "strconv" 12 | "time" 13 | ) 14 | 15 | var ( 16 | nameSpace string 17 | scalePercentage int 18 | thresholdPercentage int 19 | pvcName string 20 | ) 21 | 22 | // ResizeFunction : Is the main driver code checks for PV usage and scales up the PV when and as defined. 23 | func ResizeFunction() { 24 | infos := utils.GetConfigurations() 25 | logger.LogStdout() 26 | for _, info := range infos { 27 | nameSpace = fmt.Sprintf("%v", info["namespace"]) 28 | scalePercentage, _ = strconv.Atoi(fmt.Sprintf("%v", info["scale_percentage"])) 29 | thresholdPercentage, _ = strconv.Atoi(fmt.Sprintf("%v", info["threshold_percentage"])) 30 | pvcName = fmt.Sprintf("%v", info["pvc_name"]) 31 | if (100 - api.GetPersistentVolumeList(nameSpace, pvcName).Value) >= thresholdPercentage { 32 | updatedSize := utils.CalculateUpdatedSize(api.GetPeristentVolumeUsage(nameSpace, pvcName).Value, scalePercentage) 33 | pkg.ResizePersistentVolume(pvcName, nameSpace, updatedSize) 34 | for _, pod := range pkg.ListPods(nameSpace) { 35 | if pod.PersistentVolumeName == pvcName { 36 | time.Sleep(100 * time.Second) 37 | pkg.DeletePod(pod.PodName, nameSpace) 38 | } 39 | } 40 | } else { 41 | log.WithFields(log.Fields{ 42 | "namespace": nameSpace, 43 | "persistent_volume_name": pvcName, 44 | }).Info("Threshold is under control, no need of resizing") 45 | } 46 | } 47 | } 48 | 49 | func main() { 50 | scheduler := gocron.NewScheduler() 51 | scheduler.Every(100).Seconds().Do(ResizeFunction) 52 | <-scheduler.Start() 53 | } 54 | -------------------------------------------------------------------------------- /pkg/k8s.go: -------------------------------------------------------------------------------- 1 | package pkg 2 | 3 | import ( 4 | "dynamic-pv-scaling/api" 5 | "dynamic-pv-scaling/logger" 6 | log "github.com/sirupsen/logrus" 7 | "k8s.io/api/core/v1" 8 | "k8s.io/apimachinery/pkg/api/resource" 9 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 10 | "strconv" 11 | ) 12 | 13 | // PodList defines struct for json key values as mentioned below. 14 | type PodList struct { 15 | PodName string `json:"pod_name"` 16 | PersistentVolumeName string `json:"persistent_volume_name"` 17 | } 18 | 19 | // ListPods function takes namespace as input and returns PodList with list of all the pods running in the given namespace */ 20 | func ListPods(namespace string) []PodList { 21 | var podLists []PodList 22 | var podInformation PodList 23 | logger.LogStdout() 24 | 25 | clientset := api.CreateClient() 26 | pods, err := clientset.CoreV1().Pods(namespace).List(metav1.ListOptions{}) 27 | if err != nil { 28 | log.WithFields(log.Fields{ 29 | "namespace": namespace, 30 | }).Error(err.Error()) 31 | } 32 | for _, pod := range pods.Items { 33 | for _, volume := range pod.Spec.Volumes { 34 | if volume.PersistentVolumeClaim != nil { 35 | podInformation = PodList{ 36 | PodName: pod.GetName(), 37 | PersistentVolumeName: volume.PersistentVolumeClaim.ClaimName, 38 | } 39 | podLists = append(podLists, podInformation) 40 | } 41 | } 42 | } 43 | 44 | log.WithFields(log.Fields{ 45 | "namespace": namespace, 46 | }).Info("Successfully listed pods with persistent volumes") 47 | 48 | return podLists 49 | } 50 | 51 | // DeletePod function takes podName and nameSpace as input and deleted the said pod in the given namespace */ 52 | func DeletePod(podName string, nameSpace string) { 53 | logger.LogStdout() 54 | 55 | clientset := api.CreateClient() 56 | deletePolicy := metav1.DeletePropagationForeground 57 | 58 | podClient := clientset.CoreV1().Pods(nameSpace) 59 | 60 | err := podClient.Delete(podName, &metav1.DeleteOptions{PropagationPolicy: &deletePolicy}) 61 | 62 | if err != nil { 63 | log.WithFields(log.Fields{ 64 | "pod": podName, 65 | }).Error(err.Error()) 66 | } 67 | 68 | log.WithFields(log.Fields{ 69 | "pod": podName, 70 | }).Info("Successfully deleted the pod to resize persistent volume") 71 | } 72 | 73 | // ResizePersistentVolume takes pvcName to increase size of in nameSpace given and with the value requred */ 74 | func ResizePersistentVolume(pvcName string, nameSpace string, value int) { 75 | logger.LogStdout() 76 | 77 | clientset := api.CreateClient() 78 | rawPersistentVolumeClaim, err := clientset.CoreV1().PersistentVolumeClaims(nameSpace).Get(pvcName, metav1.GetOptions{}) 79 | if err != nil { 80 | log.WithFields(log.Fields{ 81 | "pvc": pvcName, 82 | }).Error(err.Error()) 83 | } 84 | 85 | updateValue := strconv.Itoa(value) + "Gi" 86 | rawPersistentVolumeClaim.Spec.Resources.Requests[v1.ResourceStorage], err = resource.ParseQuantity(updateValue) 87 | if err != nil { 88 | log.WithFields(log.Fields{ 89 | "pvc": pvcName, 90 | }).Error(err.Error()) 91 | } 92 | _, err = clientset.CoreV1().PersistentVolumeClaims(nameSpace).Update(rawPersistentVolumeClaim) 93 | if err != nil { 94 | log.WithFields(log.Fields{ 95 | "pvc": pvcName, 96 | }).Error(err.Error()) 97 | } 98 | 99 | log.WithFields(log.Fields{ 100 | "pvc": pvcName, 101 | }).Info("Successfully resized the pvc, the new size is " + updateValue) 102 | } 103 | -------------------------------------------------------------------------------- /scripts/k8s-validation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | deploy_chart() { 4 | echo "--------------Deploying Helm Chart--------------" 5 | helm upgrade dynamic-pv-scaler ./deploy/helm -f \ 6 | ./deploy/helm/values.yaml --install --namespace dynamic-pv-scaler 7 | } 8 | 9 | validate_chart() { 10 | echo "--------------Testing Helm Chart--------------" 11 | helm test dynamic-pv-scaler --namespace dynamic-pv-scaler 12 | } 13 | 14 | lint_chart() { 15 | echo "--------------Linting Helm Chart--------------" 16 | helm lint ./deploy/helm/. 17 | } 18 | 19 | validate_container_state() { 20 | echo "--------------Validating Deployment Status--------------" 21 | output=$(kubectl get pods -n keycloak -l app=dynamic-pv-scaler \ 22 | -o jsonpath="{.items[*]['status.phase']}") 23 | if [ "${output}" != "Running" ] && [ "${output}" != "" ] 24 | then 25 | echo "Container is not healthy" 26 | exit 1 27 | else 28 | echo "Container is running fine" 29 | fi 30 | } 31 | 32 | main_function() { 33 | lint_chart 34 | deploy_chart 35 | validate_chart 36 | sleep 30s 37 | validate_container_state 38 | } 39 | 40 | main_function 41 | -------------------------------------------------------------------------------- /static/dynamic-pv-scaler-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opstree/dynamic-pv-scaler/dc9ca9cae5e5eda7382fe96ef86e6c78f6b4a734/static/dynamic-pv-scaler-arch.png -------------------------------------------------------------------------------- /static/dynamic-pv-scaler-logging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opstree/dynamic-pv-scaler/dc9ca9cae5e5eda7382fe96ef86e6c78f6b4a734/static/dynamic-pv-scaler-logging.png -------------------------------------------------------------------------------- /static/dynamic-pv-scaler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opstree/dynamic-pv-scaler/dc9ca9cae5e5eda7382fe96ef86e6c78f6b4a734/static/dynamic-pv-scaler.png -------------------------------------------------------------------------------- /static/dynamic-pv-scaler.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /utils/calculate.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "dynamic-pv-scaling/logger" 5 | log "github.com/sirupsen/logrus" 6 | "strconv" 7 | ) 8 | 9 | // CalculateUpdatedSize function takes value(int) and percentage(int) as input and returns updated value for PV(int) 10 | func CalculateUpdatedSize(value int, percentage int) int { 11 | logger.LogStdout() 12 | 13 | initialValue := value * percentage / 100 14 | updateValue := value + initialValue 15 | log.WithFields(log.Fields{ 16 | "Scale Percentage": percentage, 17 | }).Info("Successfully calculated percentage, the new size is " + strconv.Itoa(updateValue)) 18 | return updateValue 19 | } 20 | -------------------------------------------------------------------------------- /utils/yaml2json.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "github.com/ghodss/yaml" 7 | "io/ioutil" 8 | "os" 9 | ) 10 | 11 | // Converts given YAML file to json , Takes filename as input and returns results as interface. 12 | func yamlToJSON(filename string) []map[string]interface{} { 13 | file, err := ioutil.ReadFile(filename) 14 | checkError(err) 15 | 16 | data, err := yaml.YAMLToJSON(file) 17 | checkError(err) 18 | 19 | var results []map[string]interface{} 20 | err = json.Unmarshal(data, &results) 21 | checkError(err) 22 | return results 23 | } 24 | 25 | // Checks for any error 26 | func checkError(err error) bool { 27 | if err != nil { 28 | fmt.Println(err.Error()) 29 | } 30 | return (err != nil) 31 | } 32 | 33 | //GetConfigurations is responsible to get configFile location , converts it to json and returns the same. 34 | func GetConfigurations() []map[string]interface{} { 35 | 36 | configFile := os.Getenv("CONFIG_FILE") 37 | config := yamlToJSON(configFile) 38 | return config 39 | } 40 | --------------------------------------------------------------------------------