-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from maxime1907/enhance-chart
feat: enhance chart features, add daemonset, add linting ci
- Loading branch information
Showing
16 changed files
with
470 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Lint and Test Charts | ||
|
||
# Controls when the action will run. Triggers the workflow on pull request | ||
# events but only for the main branch | ||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
lint-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Validate schema | ||
uses: wiremind/[email protected] | ||
with: | ||
path: charts | ||
config: config_repos | ||
|
||
- name: Cleanup subcharts after kubeval | ||
run: rm -rf charts/*/charts | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct --config ct.yaml list-changed) | ||
if [[ -n "$changed" ]]; then | ||
echo "::set-output name=changed::true" | ||
fi | ||
- name: Run chart-testing (lint) | ||
run: ct lint --config ct.yaml | ||
|
||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
if: steps.list-changed.outputs.changed == 'true' | ||
|
||
- name: Deploy Prometheus Operator crds | ||
run: | | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.55.0/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.55.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.55.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml | ||
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.55.0/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml | ||
- name: Run chart-testing (install) | ||
run: ct install --config ct.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,11 +22,9 @@ jobs: | |
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.4.0 | ||
version: v3.5.0 | ||
|
||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
with: | ||
charts_dir: charts | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
apiVersion: v2 | ||
name: docker-hub-rate-limit-exporter | ||
description: Export your current docker hub rate limit status to prometheus. | ||
icon: https://github.com/viadee/docker-hub-rate-limit-exporter/raw/main/chart/icon.png | ||
|
||
icon: https://raw.githubusercontent.com/viadee/docker-hub-rate-limit-exporter/main/charts/docker-hub-rate-limit-exporter-chart/icon.png | ||
keywords: | ||
- docker | ||
- hub | ||
- rate | ||
- limit | ||
- exporter | ||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
|
@@ -11,14 +16,25 @@ icon: https://github.com/viadee/docker-hub-rate-limit-exporter/raw/main/chart/ic | |
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.2.11 | ||
version: 0.3.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
appVersion: 1.16.0 | ||
appVersion: version-1.6 | ||
|
||
home: https://github.com/viadee/docker-hub-rate-limit-exporter/ | ||
sources: | ||
- https://github.com/viadee/docker-hub-rate-limit-exporter/ | ||
maintainers: | ||
- email: [email protected] | ||
name: sebastiansirch | ||
- email: [email protected] | ||
name: fkoehne | ||
- email: [email protected] | ||
name: mstein11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
charts/docker-hub-rate-limit-exporter-chart/ci/all-enabled-values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# Default values for docker-hub-rate-limit-exporter. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
config: | ||
# Log level of the exporter | ||
verbosity: 1 | ||
dockerhub: | ||
username: "" | ||
password: "" | ||
|
||
deployment: | ||
enabled: true | ||
replicaCount: 1 | ||
podAnnotations: {} | ||
|
||
daemonset: | ||
enabled: true | ||
updateStrategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
podAnnotations: {} | ||
|
||
|
||
image: | ||
repository: viadee/docker-hub-rate-limit-exporter | ||
tag: "" | ||
pullPolicy: IfNotPresent | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
serviceMonitor: | ||
enabled: true | ||
additionalLabels: {} | ||
namespace: "" | ||
|
||
jobLabel: "" | ||
|
||
scheme: http | ||
bearerTokenFile: | ||
tlsConfig: {} | ||
|
||
## proxyUrl: URL of a proxy that should be used for scraping. | ||
## | ||
proxyUrl: "" | ||
|
||
## Override serviceMonitor selector | ||
## | ||
selectorOverride: {} | ||
|
||
relabelings: | ||
- action: replace | ||
sourceLabels: | ||
- __meta_kubernetes_pod_node_name | ||
targetLabel: instance | ||
- action: replace | ||
sourceLabels: | ||
- __meta_kubernetes_pod_host_ip | ||
targetLabel: host_ip | ||
metricRelabelings: [] | ||
interval: "" | ||
scrapeTimeout: 25s | ||
|
||
serviceAccount: | ||
# Specifies whether a service account should be created | ||
create: true | ||
# Annotations to add to the service account | ||
annotations: {} | ||
# The name of the service account to use. | ||
# If not set and create is true, a name is generated using the fullname template | ||
name: "" | ||
|
||
podAnnotations: | ||
sidecar.istio.io/inject: "false" | ||
|
||
podSecurityContext: | ||
fsGroup: 65534 | ||
runAsGroup: 65534 | ||
runAsNonRoot: true | ||
runAsUser: 65534 | ||
|
||
securityContext: | ||
capabilities: | ||
add: | ||
- SYS_TIME | ||
|
||
service: | ||
type: ClusterIP | ||
port: 9100 | ||
targetPort: 9100 | ||
nodePort: | ||
portName: metrics | ||
annotations: {} | ||
|
||
livenessProbeTimeoutSeconds: 5 | ||
|
||
readinessProbeTimeoutSeconds: 5 | ||
|
||
resources: | ||
limits: | ||
cpu: 200m | ||
memory: 96Mi | ||
requests: | ||
cpu: 50m | ||
memory: 64Mi | ||
|
||
nodeSelector: {} | ||
|
||
tolerations: [] | ||
|
||
priorityClassName: "" | ||
|
||
affinity: {} | ||
|
||
# Expose the service to the host network | ||
hostNetwork: false | ||
|
||
# Share the host process ID namespace | ||
hostPID: true |
7 changes: 4 additions & 3 deletions
7
charts/docker-hub-rate-limit-exporter-chart/templates/configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{{- $config := default dict .Values.config }} | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "docker-hub-rate-limit-exporter.fullname" . }}-configmap | ||
labels: | ||
{{- include "docker-hub-rate-limit-exporter.labels" . | nindent 4 }} | ||
data: | ||
exporter-port: {{ default "80" .Values.config.exporterPort | quote }} | ||
exporter-verbosity: {{ default "1" .Values.config.exporterVerbosity | quote }} | ||
dockerhub-username: {{ default "" .Values.config.dockerhubUsername | quote }} | ||
exporter-port: {{ .Values.service.targetPort | quote }} | ||
exporter-verbosity: {{ hasKey $config "verbosity" | ternary $config.verbosity 1 | quote }} |
Oops, something went wrong.