Skip to content

Commit

Permalink
Merge pull request #1 from Webfleet-Solutions/feature/prepare-fork
Browse files Browse the repository at this point in the history
Prepare fork with README and CI adaptations
  • Loading branch information
mowoe authored Dec 12, 2023
2 parents 908b3b0 + 3f52f5d commit 1d0a6e8
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 121 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Test and build

on:
push:
branches:
- master

pull_request:
branches:
- master


permissions: write-all

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.19'

- uses: actions/[email protected]

- name: Test With Coverage
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
files: coverage.txt

- name: golangci-lint
uses: golangci/[email protected]
with:
args: --timeout=5m
# since go test already does it in a previous step
skip-pkg-cache: true

build-image:
runs-on: ubuntu-latest
needs: test
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build image
uses: docker/build-push-action@v5
with:
# Only for CI testing purposes
push: false
tags: wfs/k8s-image-availability-exporter:latest
46 changes: 0 additions & 46 deletions .github/workflows/chart.yml

This file was deleted.

69 changes: 0 additions & 69 deletions .github/workflows/ci.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/push-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and push image

on:

# publish on releases, e.g. v2.1.13 (image tagged as "2.1.13" - "v" prefix is removed)
release:
types: [ published ]

# publish on pushes to the main branch (image tagged as "latest")
push:
branches:
- master

permissions: write-all

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build and publish a Docker image for ${{ github.repository }}
uses: macbre/push-to-ghcr@master
with:
context: "."
dockerfile: ./Dockerfile
image_name: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/release_helmchart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Charts

on:
push:
branches:
- master

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: helm/charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# k8s-image-availability-exporter

This is a fork aiming at fixing or at least circumventing the problems described in [Issue #7 of the upstream repository](https://github.com/deckhouse/k8s-image-availability-exporter/issues/7).

As the upstream repo uses private build infrastructure, the CI process has been adapted and the master branch of this repo should not be merged into the upstream repo for this reason.

To add a feature in this repository: Create a new branch in from the upstream repo as described [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository).
Then, merge your feature branch in both this repositories and the upstream `master` branches.

---
k8s-image-availability-exporter (or *k8s-iae* for short) is a Prometheus exporter that warns you proactively about images that are defined in Kubernetes objects (e.g., an `image` field in the Deployment) but are not available in the container registry (such as Docker Registry, etc.).

Receiving alerts when container images related to running Kubernetes controllers are missing helps you to solve the problem before it manifests itself. For more details on the reasons behind k8s-iae and how it works, please read [this article](https://medium.com/flant-com/prometheus-exporter-to-check-kubernetes-images-availability-26c306c44c08).
Expand Down
8 changes: 4 additions & 4 deletions helm/charts/k8s-image-availability-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ This chart bootstraps a [k8s-image-availability-exporter](https://github.com/fla
To install the chart with the release name `my-release`:

```bash
helm repo add flant_common_github https://charts.flant.com/common/github
helm repo add webfleet-k8s-iae https://Webfleet-Solutions.github.io/k8s-image-availability-exporter
helm repo update
helm install my-release flant_common_github/k8s-image-availability-exporter
helm install my-release webfleet-k8s-iae/k8s-image-availability-exporter
```

The command deploys k8s-image-availability-exporter on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
Expand All @@ -40,8 +40,8 @@ The following tables list the configurable parameters of the k8s-image-availabil
| Parameter | Description | Default |
| ----- | ----------- | ------ |
| `k8sImageAvailabilityExporter.image.pullPolicy` | Image pull policy to use for the k8s-image-availability-exporter deployment | `IfNotPresent` |
| `k8sImageAvailabilityExporter.image.repository` | Repository to use for the k8s-image-availability-exporter deployment | `flant/k8s-image-availability-exporter` |
| `k8sImageAvailabilityExporter.image.tag` | Tag to use for the k8s-image-availability-exporter deployment | `v0.1.13` |
| `k8sImageAvailabilityExporter.image.repository` | Repository to use for the k8s-image-availability-exporter deployment | `ghcr.io/Webfleet-Solutions/k8s-image-availability-exporter` |
| `k8sImageAvailabilityExporter.image.tag` | Tag to use for the k8s-image-availability-exporter deployment | `latest` |
| `k8sImageAvailabilityExporter.replicas` | Number of instances to deploy for a k8s-image-availability-exporter deployment. | `1` |
| `k8sImageAvailabilityExporter.resources` | Resource limits for k8s-image-availability-exporter | `{}` |
| `serviceMonitor.enabled` | Create [Prometheus Operator](https://github.com/coreos/prometheus-operator) serviceMonitor resource | `false` |
Expand Down
4 changes: 2 additions & 2 deletions helm/charts/k8s-image-availability-exporter/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
k8sImageAvailabilityExporter:
image:
repository: registry.deckhouse.io/k8s-image-availability-exporter/k8s-image-availability-exporter
tag: v0.5.1
repository: ghcr.io/Webfleet-Solutions/k8s-image-availability-exporter
tag: latest
pullPolicy: IfNotPresent
replicas: 1
resources: {}
Expand Down

0 comments on commit 1d0a6e8

Please sign in to comment.