├── README.md ├── charts ├── icon.png ├── .relok8s-images.yaml ├── templates │ ├── configmap.yaml │ ├── _helpers.tpl │ └── daemonset.yaml ├── Chart.yaml ├── README.md └── values.yaml ├── scripts └── perpare_build_env.sh ├── .yamllint ├── docs └── quick-start-in-china.md ├── .gitignore ├── CHANGELOG.md ├── .github ├── dependabot.yml └── workflows │ ├── tests.yaml │ └── release.yaml ├── Makefile ├── RELEASE_PROCESS.md └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | charts/README.md -------------------------------------------------------------------------------- /charts/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kubean-io/kube-node-tuning/HEAD/charts/icon.png -------------------------------------------------------------------------------- /charts/.relok8s-images.yaml: -------------------------------------------------------------------------------- 1 | - "{{ .image.registry }}/{{ .image.repository }}:{{ .image.tag }}" 2 | -------------------------------------------------------------------------------- /scripts/perpare_build_env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/v1.4.0/chart-releaser_1.4.0_linux_amd64.tar.gz" 4 | tar -xzf cr.tar.gz 5 | rm -f cr.tar.gz 6 | chmod +x cr 7 | mv cr /usr/local/bin -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | 4 | ignore: | 5 | .git/ 6 | 7 | rules: 8 | braces: 9 | min-spaces-inside: 0 10 | max-spaces-inside: 1 11 | brackets: 12 | min-spaces-inside: 0 13 | max-spaces-inside: 1 14 | indentation: 15 | spaces: 2 16 | indent-sequences: consistent 17 | line-length: disable 18 | -------------------------------------------------------------------------------- /docs/quick-start-in-china.md: -------------------------------------------------------------------------------- 1 | # Quick Start in China 2 | 3 | If the machine is in China, you should replace the command as below(to use registry mirror: docker.m.daocloud.io): 4 | 5 | ``` 6 | helm install -n kube-node-tuning kube-node-tuning kube-node-tuning/kube-node-tuning --create-namespace --set image.registry=docker.m.daocloud.io 7 | ``` 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 0.3.1 4 | 5 | #### Enhancements: 6 | 7 | update image.repository on values.yaml 8 | 9 | --- 10 | 11 | ## 0.3.0 12 | 13 | #### Features: 14 | 15 | relok8s adaptation 16 | 17 | --- 18 | 19 | ## 0.2.0 20 | 21 | #### Enhancements: 22 | 23 | [#25] use busybox base image 24 | 25 | --- 26 | 27 | ## 0.1.0 28 | 29 | #### Enhancements: 30 | 31 | First Release 32 | -------------------------------------------------------------------------------- /charts/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ .Values.configmap.name }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: 8 | {{ include "kube-node-tuning.labels" . | indent 4 }} 9 | data: 10 | 99-kube-node-tuning.conf: |- 11 | {{ index .Values "configmap" "sysctl-conf" | nindent 4 }} 12 | setup.sh: |- 13 | {{ index .Values "configmap" "setup-sh" | nindent 4 }} 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | --- 7 | version: 2 8 | updates: 9 | - package-ecosystem: "github-actions" 10 | directory: "/" 11 | schedule: 12 | interval: "daily" 13 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | .PHONY: test 3 | test: 4 | yamllint -s . || true 5 | helm lint charts/ --strict 6 | 7 | GITHUB_OWNER?=kubean-io 8 | GITHUB_REPO?=kube-node-tuning 9 | GITHUB_TOKEN?= 10 | 11 | helm-chart-release: 12 | @cr package charts 13 | @cr upload -o $(GITHUB_OWNER) -r $(GITHUB_REPO) -t $(GITHUB_TOKEN) 14 | @helm repo index . 15 | @cr index -o $(GITHUB_OWNER) -r $(GITHUB_REPO) -t $(GITHUB_TOKEN) --pr -i index.yaml -c https://kubean-io.github.io/kube-node-tuning/ 16 | 17 | clean: 18 | rm -rf .cr-* 19 | -------------------------------------------------------------------------------- /charts/Chart.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v2 3 | description: | 4 | kube-node-tuning is aimed at kernel tuning by kubernetes. 5 | It's useful to High performance application, Large Scale Cluster, Network Tuning. 6 | home: https://github.com/kubean-io/kube-node-tuning 7 | icon: https://raw.githubusercontent.com/kubean-io/kube-node-tuning/main/charts/icon.png 8 | keywords: 9 | - tuning 10 | - sysctl 11 | name: kube-node-tuning 12 | sources: 13 | - https://github.com/kubean-io/kube-node-tuning 14 | appVersion: 0.3.1 15 | version: 0.3.1 16 | -------------------------------------------------------------------------------- /.github/workflows/tests.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Tests 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | # The branches below must be a subset of the branches above 8 | branches: [ main ] 9 | schedule: 10 | - cron: "0 0 * * 0" 11 | workflow_dispatch: 12 | jobs: 13 | test: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | - name: Prepare Environment 18 | run: | 19 | curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash 20 | - uses: actions/setup-go@v6 21 | with: 22 | go-version: "1.17.8" 23 | - run: | 24 | make test 25 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | workflow_dispatch: 8 | 9 | jobs: 10 | release-charts: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v4 15 | with: 16 | fetch-depth: 0 17 | - name: Configure Git 18 | run: | 19 | git config user.name "$GITHUB_ACTOR" 20 | git config user.email "$GITHUB_ACTOR@users.noreply.github.com" 21 | - name: Chart releaser 22 | if: startsWith(github.ref, 'refs/tags/v') # we craft releases only for tags 23 | run: | 24 | bash scripts/perpare_build_env.sh 25 | 26 | repo=$(basename "$GITHUB_REPOSITORY") 27 | owner=$(dirname "$GITHUB_REPOSITORY") 28 | tag="${GITHUB_REF_NAME:1}" 29 | export GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" 30 | 31 | exists=$(curl -s -H "Accept: application/vnd.github.v3+json" https://github.com/$GITHUB_REPOSITORY/releases/tag/$repo-chart-$tag -w %{http_code} -o /dev/null) 32 | if [[ $exists != "200" ]]; then 33 | echo "Creating release..." 34 | make helm-chart-release 35 | else 36 | echo "Release already exists" 37 | fi 38 | -------------------------------------------------------------------------------- /RELEASE_PROCESS.md: -------------------------------------------------------------------------------- 1 | # Release Process 2 | 3 | This is the process to follow to make a new release. 4 | Similar to Semantic Version. The project refers to the respective components of this triple as `..`. 5 | 6 | Steps: 7 | 8 | 1. Check the issue tracker milestone. 9 | 1. [Write release notes](#Write release notes) 10 | 1. [Change the hardcoded version in code **Mannaly**](#Change the hardcoded version in code **Mannaly**) 11 | 1. [Tag Version](#Tag Version) 12 | 13 | ## Write release notes 14 | 15 | All release notes are always written on the `main` branch, and 16 | copied into release branches in a later step. 17 | 18 | Commit it with the message: "Update Release Note version XXX" 19 | 20 | ## Change the hardcoded version in code **Mannaly** 21 | 22 | The code is at: 23 | 24 | * README.md 25 | * charts/Chart.yml 26 | 27 | Commit it with the message: "Dump version vXXX" 28 | 29 | ## Tag Version 30 | 31 | * Add a tag through git tag -s ${VERSION}. 32 | * Push the tag to GitHub through git push origin tags/$VERSION. 33 | * The image and helm charts would release automanly 34 | * Merge the generated "Update index.yaml" PR **Mannaly** 35 | 36 | ### Brag about new release 37 | 38 | Tweet, post to G+, slack, IRC, whatever. Make some noise, if it's 39 | worth making noise about! 40 | -------------------------------------------------------------------------------- /charts/README.md: -------------------------------------------------------------------------------- 1 | # kube-node-tuning 2 | 3 | kube-node-tuning is aimed at kernel tuning by kubernetes. It's useful to : 4 | 5 | * High performance application 6 | * Large Scale Cluster 7 | * Network Tuning 8 | 9 | ## Quick Start 10 | 11 | ``` 12 | export VERSION=v0.3.1 13 | helm repo add kube-node-tuning https://kubean-io.github.io/kube-node-tuning/ 14 | helm install -n kube-node-tuning kube-node-tuning kube-node-tuning/kube-node-tuning --version $VERSION --create-namespace 15 | 16 | ``` 17 | 18 | Tips: If the machine is in China, you should following by: [quick-start-in-china](docs/quick-start-in-china.md) 19 | 20 | The kernel's sysctl settings are applied to the node at /etc/99-kube-node-tuning.conf. 21 | 22 | Check if the settings are applied by the following command. 23 | SSH to the node of cluster 24 | 25 | ``` 26 | cat /etc/sysctl.d/99-kube-node-tuning.conf 27 | sysctl -a # view the sysctl setting 28 | ``` 29 | 30 | ## Configuration 31 | 32 | ``` 33 | # Change the config 34 | kubectl -n kube-node-tuning edit cm/kube-node-tuning-config -o yaml 35 | 36 | # Restart the DaemonSet 37 | kubectl -n kube-node-tuning rollout restart ds kube-node-tuning 38 | ``` 39 | 40 | 41 | ## Roadmap 42 | 43 | * Different OS Support. (Ubuntu, CentOS, RHEL, etc.) 44 | * Multi profile 45 | * Operator instead of Daemonset 46 | -------------------------------------------------------------------------------- /charts/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "kube-node-tuning.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 "kube-node-tuning.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 "kube-node-tuning.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 32 | {{- end -}} 33 | 34 | {{/* 35 | Common labels 36 | */}} 37 | {{- define "kube-node-tuning.labels" -}} 38 | helm.sh/chart: {{ include "kube-node-tuning.chart" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} 43 | {{ include "kube-node-tuning.selectorLabels" . }} 44 | 45 | {{- end -}} 46 | 47 | {{/* 48 | Selector labels 49 | */}} 50 | {{- define "kube-node-tuning.selectorLabels" -}} 51 | app.kubernetes.io/name: {{ include "kube-node-tuning.name" . }} 52 | app.kubernetes.io/instance: {{ .Release.Name }} 53 | {{- end -}} 54 | -------------------------------------------------------------------------------- /charts/values.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | ## @section parameters 3 | 4 | ## @param image.registry Fluentd image registry 5 | ## @param image.repository Fluentd image repository 6 | ## @param image.tag Fluentd image tag (immutable tags are recommended) 7 | ## @param image.pullPolicy Fluentd image pull policy 8 | ## @param image.pullSecrets Fluentd image pull secrets 9 | ## 10 | image: 11 | registry: docker.io 12 | repository: library/busybox 13 | tag: stable 14 | ## Specify a imagePullPolicy 15 | ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' 16 | ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images 17 | ## 18 | pullPolicy: IfNotPresent 19 | ## Optionally specify an array of imagePullSecrets. 20 | ## Secrets must be manually created in the namespace. 21 | ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ 22 | ## 23 | ## pullSecrets: 24 | ## - myRegistryKeySecretName 25 | pullSecrets: [] 26 | 27 | configmap: 28 | # specify the config map name 29 | name: kube-node-tuning-config 30 | 31 | sysctl-conf: |- 32 | kernel.pid_max=4194304 33 | net.netfilter.nf_conntrack_max=1048576 34 | fs.inotify.max_user_watches=65536 35 | fs.inotify.max_user_instances=8192 36 | 37 | net.ipv4.neigh.default.gc_thresh1=8192 38 | net.ipv4.neigh.default.gc_thresh2=32768 39 | net.ipv4.neigh.default.gc_thresh3=65536 40 | net.ipv6.neigh.default.gc_thresh1=8192 41 | net.ipv6.neigh.default.gc_thresh2=32768 42 | net.ipv6.neigh.default.gc_thresh3=65536 43 | setup-sh: |- 44 | #!/bin/sh 45 | set -ex 46 | cp 99-kube-node-tuning.conf /etc/sysctl.d 47 | sysctl -p /etc/sysctl.d/99-kube-node-tuning.conf 48 | 49 | podAnnotations: {} 50 | 51 | resources: {} 52 | # We usually recommend not to specify default resources and to leave this as a conscious 53 | # choice for the user. This also increases chances charts run on environments with little 54 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 55 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 56 | # limits: 57 | # cpu: 100m 58 | # memory: 128Mi 59 | # requests: 60 | # cpu: 100m 61 | # memory: 128Mi 62 | -------------------------------------------------------------------------------- /charts/templates/daemonset.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: DaemonSet 4 | metadata: 5 | name: {{ include "kube-node-tuning.fullname" . }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: 8 | {{ include "kube-node-tuning.labels" . | indent 4 }} 9 | spec: 10 | selector: 11 | matchLabels: 12 | app.kubernetes.io/name: {{ include "kube-node-tuning.name" . }} 13 | app.kubernetes.io/instance: {{ .Release.Name }} 14 | updateStrategy: 15 | rollingUpdate: 16 | maxUnavailable: 100% 17 | template: 18 | metadata: 19 | {{- with .Values.podAnnotations }} 20 | annotations: 21 | {{- toYaml . | nindent 8 }} 22 | {{- end }} 23 | labels: 24 | app.kubernetes.io/name: {{ include "kube-node-tuning.name" . }} 25 | app.kubernetes.io/instance: {{ .Release.Name }} 26 | spec: 27 | initContainers: 28 | - name: setup-sysctl 29 | image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }} 30 | imagePullPolicy: {{ .Values.image.pullPolicy }} 31 | command: 32 | - /bin/sh 33 | - setup.sh 34 | workingDir: /opt/kube-node-tuning 35 | volumeMounts: 36 | - name: sysctl-config-volume 37 | mountPath: /opt/kube-node-tuning 38 | - name: sysctl-dir 39 | mountPath: /etc/sysctl.d 40 | securityContext: 41 | privileged: true 42 | runAsUser: 0 43 | {{- with .Values.image.pullSecrets }} 44 | imagePullSecrets: 45 | {{- toYaml . | nindent 8 }} 46 | {{- end }} 47 | containers: 48 | - name: kube-node-tuning 49 | image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }} 50 | imagePullPolicy: {{ .Values.image.pullPolicy }} 51 | command: 52 | - sleep 53 | - infinity 54 | resources: 55 | {{- toYaml .Values.resources | nindent 12 }} 56 | {{- with .Values.image.pullSecrets }} 57 | imagePullSecrets: 58 | {{- toYaml . | nindent 8 }} 59 | {{- end }} 60 | nodeSelector: 61 | kubernetes.io/os: linux 62 | priorityClassName: system-node-critical 63 | tolerations: 64 | - operator: Exists 65 | volumes: 66 | - name: sysctl-config-volume 67 | configMap: 68 | name: {{ .Values.configmap.name }} 69 | - name: sysctl-dir 70 | hostPath: 71 | path: /etc/sysctl.d 72 | type: "" 73 | hostNetwork: true 74 | terminationGracePeriodSeconds: 0 75 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------