Skip to content

Commit

Permalink
rename to saffire (#13)
Browse files Browse the repository at this point in the history
* rename to saffire

* rename crd

* update
  • Loading branch information
Andrew Suderman authored Feb 25, 2021
1 parent 92e78f9 commit 5fb2cae
Show file tree
Hide file tree
Showing 26 changed files with 83 additions and 80 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ references:

jobs:
release:
working_directory: /go/src/github.com/fairwindsops/kuiper
working_directory: /go/src/github.com/fairwindsops/saffire
docker:
- image: goreleaser/goreleaser:v0.155.2
environment:
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
name: Publish Docs Site to S3
command: |
cd ./dist
aws s3 sync ./ s3://kuiper.docs.fairwinds.com --delete
aws s3 sync ./ s3://saffire.docs.fairwinds.com --delete
workflows:
version: 2
test:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/pre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -e

docker cp ./ e2e-command-runner:/kuiper
docker cp ./ e2e-command-runner:/saffire
2 changes: 1 addition & 1 deletion .circleci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ chmod +x kustomize
mv kustomize /usr/local/bin/kustomize

# Run tests
cd /kuiper/
cd /saffire/
make all install
USE_EXISTING_CLUSTER=true make test
42 changes: 21 additions & 21 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,44 @@ builds:
- 7
dockers:
- image_templates:
- "quay.io/fairwinds/kuiper:{{ .Tag }}-amd64"
- "quay.io/fairwinds/kuiper:v{{ .Major }}-amd64"
- "quay.io/fairwinds/kuiper:v{{ .Major }}.{{ .Minor }}-amd64"
- "quay.io/fairwinds/saffire:{{ .Tag }}-amd64"
- "quay.io/fairwinds/saffire:v{{ .Major }}-amd64"
- "quay.io/fairwinds/saffire:v{{ .Major }}.{{ .Minor }}-amd64"
use_buildx: true
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "quay.io/fairwinds/kuiper:{{ .Tag }}-arm64v8"
- "quay.io/fairwinds/kuiper:v{{ .Major }}-arm64v8"
- "quay.io/fairwinds/kuiper:v{{ .Major }}.{{ .Minor }}-arm64v8"
- "quay.io/fairwinds/saffire:{{ .Tag }}-arm64v8"
- "quay.io/fairwinds/saffire:v{{ .Major }}-arm64v8"
- "quay.io/fairwinds/saffire:v{{ .Major }}.{{ .Minor }}-arm64v8"
use_buildx: true
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
- image_templates:
- "quay.io/fairwinds/kuiper:{{ .Tag }}-armv7"
- "quay.io/fairwinds/kuiper:v{{ .Major }}-armv7"
- "quay.io/fairwinds/kuiper:v{{ .Major }}.{{ .Minor }}-armv7"
- "quay.io/fairwinds/saffire:{{ .Tag }}-armv7"
- "quay.io/fairwinds/saffire:v{{ .Major }}-armv7"
- "quay.io/fairwinds/saffire:v{{ .Major }}.{{ .Minor }}-armv7"
use_buildx: true
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm/v7"
docker_manifests:
- name_template: quay.io/fairwinds/kuiper:{{ .Tag }}
- name_template: quay.io/fairwinds/saffire:{{ .Tag }}
image_templates:
- "quay.io/fairwinds/kuiper:{{ .Tag }}-amd64"
- "quay.io/fairwinds/kuiper:{{ .Tag }}-arm64v8"
- "quay.io/fairwinds/kuiper:{{ .Tag }}-armv7"
- name_template: quay.io/fairwinds/kuiper:v{{ .Major }}
- "quay.io/fairwinds/saffire:{{ .Tag }}-amd64"
- "quay.io/fairwinds/saffire:{{ .Tag }}-arm64v8"
- "quay.io/fairwinds/saffire:{{ .Tag }}-armv7"
- name_template: quay.io/fairwinds/saffire:v{{ .Major }}
image_templates:
- "quay.io/fairwinds/kuiper:v{{ .Major }}-amd64"
- "quay.io/fairwinds/kuiper:v{{ .Major }}-arm64v8"
- "quay.io/fairwinds/kuiper:v{{ .Major }}-armv7"
- name_template: quay.io/fairwinds/kuiper:v{{ .Major }}.{{ .Minor }}
- "quay.io/fairwinds/saffire:v{{ .Major }}-amd64"
- "quay.io/fairwinds/saffire:v{{ .Major }}-arm64v8"
- "quay.io/fairwinds/saffire:v{{ .Major }}-armv7"
- name_template: quay.io/fairwinds/saffire:v{{ .Major }}.{{ .Minor }}
image_templates:
- "quay.io/fairwinds/kuiper:v{{ .Major }}.{{ .Minor }}-amd64"
- "quay.io/fairwinds/kuiper:v{{ .Major }}.{{ .Minor }}-arm64v8"
- "quay.io/fairwinds/kuiper:v{{ .Major }}.{{ .Minor }}-armv7"
- "quay.io/fairwinds/saffire:v{{ .Major }}.{{ .Minor }}-amd64"
- "quay.io/fairwinds/saffire:v{{ .Major }}.{{ .Minor }}-arm64v8"
- "quay.io/fairwinds/saffire:v{{ .Major }}.{{ .Minor }}-armv7"
4 changes: 2 additions & 2 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The current intent is that an `alternateImageSource` will be deployed alongside

## CRD

The POC or alpha version of Kuiper has the following CRD Structure for `alternateImageSource` (AIS for short):
The POC or alpha version of saffire has the following CRD Structure for `alternateImageSource` (AIS for short):

```
spec:
Expand All @@ -22,7 +22,7 @@ The `imageSourceReplacements` field contains a list. That list has two fields:

#### equivalentRepositories

These are image repositories (`image` field minus tag) that are equivalent. They are expected to have the same image tags. Upon a switch being activated, Kuiper will loop through these and use the first one that is not currently utilized.
These are image repositories (`image` field minus tag) that are equivalent. They are expected to have the same image tags. Upon a switch being activated, saffire will loop through these and use the first one that is not currently utilized.

Currently there is no plan to implement a "switch back" functionality. If the end-user desires a switch back, they can re-deploy their manifests with the original image.

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY kuiper .
COPY saffire .
USER nonroot:nonroot

ENTRYPOINT ["/kuiper"]
ENTRYPOINT ["/saffire"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Image URL to use all building/pushing image targets
IMG ?= quay.io/fairwinds/kuiper:latest
IMG ?= quay.io/fairwinds/saffire:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,crdVersions=v1"

Expand Down
4 changes: 2 additions & 2 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
domain: fairwinds.com
repo: github.com/fairwindsops/kuiper
repo: github.com/fairwindsops/saffire
resources:
- group: kuiper
- group: saffire
kind: AlternateImageSource
version: v1alpha1
version: "2"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Kuiper
# saffire

A controller to override image sources in the event that an image cannot be pulled.

Built using [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder)

## Alpha Software

At this time, Kuiper is currently in _alpha_. This means that we could change literally anything at any time without notice. Keep an eye out for major changes, and hopefully a v1 release at some point.
At this time, saffire is currently in _alpha_. This means that we could change literally anything at any time without notice. Keep an eye out for major changes, and hopefully a v1 release at some point.

## Why?

The image repository for docker images is a single point of failure for many clusters. As seen in the past with [rate limiting on Docker Hub]() and several high-profile [Quay.io outages](), these images being unavailable can produce disastrous consequences for Kubernetes cluster operators.

The intent of Kuiper is to provide operators with a method of automatically switching image repositories when `imagePullErrors` occur.
The intent of saffire is to provide operators with a method of automatically switching image repositories when `imagePullErrors` occur.

## How?

This works via controller and a CRD called an `AlternateImageSource`. The `AlternateImageSource` specifies a set of `equivalentRepositories`. These repositories *must* have the exact same image tags pushed to them. In order to achieve this, we recommend pushing images to both repositories from your CI pipeline. Here's an example `AlternateImageSource`

```
apiVersion: kuiper.fairwinds.com/v1alpha1
apiVersion: saffire.fairwinds.com/v1alpha1
kind: AlternateImageSource
metadata:
name: alternateimagesource-sample
Expand All @@ -32,4 +32,4 @@ spec:

This indicates that `quay.io/fairwinds/docker-demo` and `ehazlett/docker-demo` have the exact same image tags in both.

Once the controller and this `AlternateImageSource` are installed in your cluster, if any pod experiences an `ImgagePullError` in that namespace and the image matches one of these repositories, kuiper will find the top level controller of that pod and patch it to set the image as one of the other repositories in the `equivalentRepositories` field (currently this only applies to deployments).
Once the controller and this `AlternateImageSource` are installed in your cluster, if any pod experiences an `ImgagePullError` in that namespace and the image matches one of these repositories, saffire will find the top level controller of that pod and patch it to set the image as one of the other repositories in the `equivalentRepositories` field (currently this only applies to deployments).
6 changes: 3 additions & 3 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha1 contains API Schema definitions for the kuiper v1alpha1 API group
// Package v1alpha1 contains API Schema definitions for the saffire v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=kuiper.fairwinds.com
// +groupName=saffire.fairwinds.com
package v1alpha1

import (
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "kuiper.fairwinds.com", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "saffire.fairwinds.com", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: alternateimagesources.kuiper.fairwinds.com
name: alternateimagesources.saffire.fairwinds.com
spec:
group: kuiper.fairwinds.com
group: saffire.fairwinds.com
names:
kind: AlternateImageSource
listKind: AlternateImageSourceList
Expand Down
2 changes: 1 addition & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/kuiper.fairwinds.com_alternateimagesources.yaml
- bases/saffire.fairwinds.com_alternateimagesources.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: alternateimagesources.kuiper.fairwinds.com
name: alternateimagesources.saffire.fairwinds.com
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_alternateimagesources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: alternateimagesources.kuiper.fairwinds.com
name: alternateimagesources.saffire.fairwinds.com
spec:
conversion:
strategy: Webhook
Expand Down
4 changes: 2 additions & 2 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Adds namespace to all resources.
namespace: kuiper-system
namespace: saffire-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: kuiper-
namePrefix: saffire-

# Labels to add to all resources and selectors.
#commonLabels:
Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- /manager
args:
- --enable-leader-election
image: controller:latest
image: quay.io/fairwinds/saffire:main
name: manager
resources:
limits:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/alternateimagesource_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: alternateimagesource-editor-role
rules:
- apiGroups:
- kuiper.fairwinds.com
- saffire.fairwinds.com
resources:
- alternateimagesources
verbs:
Expand All @@ -17,7 +17,7 @@ rules:
- update
- watch
- apiGroups:
- kuiper.fairwinds.com
- saffire.fairwinds.com
resources:
- alternateimagesources/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/alternateimagesource_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ metadata:
name: alternateimagesource-viewer-role
rules:
- apiGroups:
- kuiper.fairwinds.com
- saffire.fairwinds.com
resources:
- alternateimagesources
verbs:
- get
- list
- watch
- apiGroups:
- kuiper.fairwinds.com
- saffire.fairwinds.com
resources:
- alternateimagesources/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rules:
- list
- watch
- apiGroups:
- kuiper.fairwinds.com
- saffire.fairwinds.com
resources:
- alternateimagesources
verbs:
Expand All @@ -35,7 +35,7 @@ rules:
- update
- watch
- apiGroups:
- kuiper.fairwinds.com
- saffire.fairwinds.com
resources:
- alternateimagesources/status
verbs:
Expand Down
2 changes: 1 addition & 1 deletion config/samples/kuiper_v1alpha1_alternateimagesource.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kuiper.fairwinds.com/v1alpha1
apiVersion: saffire.fairwinds.com/v1alpha1
kind: AlternateImageSource
metadata:
name: alternateimagesource-sample
Expand Down
8 changes: 4 additions & 4 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ webhooks:
service:
name: webhook-service
namespace: system
path: /mutate-kuiper-fairwinds-com-v1alpha1-alternateimagesource
path: /mutate-saffire-fairwinds-com-v1alpha1-alternateimagesource
failurePolicy: Fail
name: malternateimagesource.kb.io
rules:
- apiGroups:
- kuiper.fairwinds.com
- saffire.fairwinds.com
apiVersions:
- v1alpha1
operations:
Expand All @@ -37,12 +37,12 @@ webhooks:
service:
name: webhook-service
namespace: system
path: /validate-kuiper-fairwinds-com-v1alpha1-alternateimagesource
path: /validate-saffire-fairwinds-com-v1alpha1-alternateimagesource
failurePolicy: Fail
name: valternateimagesource.kb.io
rules:
- apiGroups:
- kuiper.fairwinds.com
- saffire.fairwinds.com
apiVersions:
- v1alpha1
operations:
Expand Down
Loading

0 comments on commit 5fb2cae

Please sign in to comment.