Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s/Fairwinds/Polaris/g #76

Merged
merged 3 commits into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ references:
echo 'export CI_TAG=$CIRCLE_TAG' >> ${BASH_ENV}
echo 'export EXTERNAL_REGISTRY_BASE_DOMAIN=quay.io' >> ${BASH_ENV}
echo 'export DOCKERFILE=Dockerfile' >> ${BASH_ENV}
echo 'export REPOSITORY_NAME=reactiveops/fairwinds' >> ${BASH_ENV}
echo 'export REPOSITORY_NAME=reactiveops/polaris' >> ${BASH_ENV}
echo 'export REGISTRY_EMAIL=none' >> ${BASH_ENV}
echo 'export DOCKERTAG=${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}' >> ${BASH_ENV}
docker_build_and_push: &docker_build_and_push
Expand All @@ -35,7 +35,7 @@ jobs:
- *docker_build_and_push

test:
working_directory: /go/src/github.com/reactiveops/fairwinds/
working_directory: /go/src/github.com/reactiveops/polaris/
docker:
- image: circleci/golang:1.11

Expand All @@ -56,7 +56,7 @@ jobs:
name: Verify helm chart synced with dashboard.yaml
command: |
diff \
<(helm template deploy/helm/fairwinds/ --name fairwinds --namespace fairwinds --set templateOnly=true) \
<(helm template deploy/helm/polaris/ --name polaris --namespace polaris --set templateOnly=true) \
deploy/dashboard.yaml || (echo "
Make sure to regenerate k8s deploy config with make helm-to-k8s" &&
exit 1)
Expand All @@ -65,7 +65,7 @@ jobs:
name: Verify helm chart synced with webhook.yaml
command: |
diff \
<(helm template deploy/helm/fairwinds/ --name fairwinds --namespace fairwinds --set templateOnly=true --set webhook.enable=true --set dashboard.enable=false) \
<(helm template deploy/helm/polaris/ --name polaris --namespace polaris --set templateOnly=true --set webhook.enable=true --set dashboard.enable=false) \
deploy/webhook.yaml || (echo "
Make sure to regenerate k8s deploy config with make helm-to-k8s" &&
exit 1)
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
*.dll
*.so
*.dylib
fairwinds
polaris

!deploy/helm/fairwinds
!deploy/helm/polaris

# Test binary, build with `go test -c`
*.test
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Contributing

Issues, whether bugs, tasks, or feature requests are essential for keeping Fairwinds great. We believe it should be as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
Issues, whether bugs, tasks, or feature requests are essential for keeping Polaris great. We believe it should be as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

## Code of Conduct

This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). Please review this document before contributing to this project.

## Project Structure

Fairwinds is built on top of [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). It can run in 3 different modes, a dashboard, a webhook, or a reporter that prints or exports validation results. All of these modes make use of the shared `validator` and `config` packages. Adding new validations is possible by only making additions to those packages.
Polaris is built on top of [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). It can run in 3 different modes, a dashboard, a webhook, or a reporter that prints or exports validation results. All of these modes make use of the shared `validator` and `config` packages. Adding new validations is possible by only making additions to those packages.

## Getting Started

We label issues with the ["good first issue" tag](https://github.com/reactiveops/fairwinds/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) if we believe they'll be a good starting point for new contributors. If you're interested in working on an issue, please start a conversation on that issue, and we can help answer any questions as they come up.
We label issues with the ["good first issue" tag](https://github.com/reactiveops/polaris/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) if we believe they'll be a good starting point for new contributors. If you're interested in working on an issue, please start a conversation on that issue, and we can help answer any questions as they come up.

## Running Tests

The following commands are all required to pass as part of Fairwinds testing:
The following commands are all required to pass as part of Polaris testing:

```
go list ./... | grep -v vendor | xargs golint -set_exit_status
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
FROM golang:1.12.4 AS build-env
WORKDIR /go/src/github.com/reactiveops/fairwinds/
WORKDIR /go/src/github.com/reactiveops/polaris/

COPY . .
RUN go get -u github.com/gobuffalo/packr/v2/packr2
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 packr2 build -a -o fairwinds *.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 packr2 build -a -o polaris *.go

FROM alpine:3.9
WORKDIR /usr/local/bin
RUN apk --no-cache add ca-certificates

RUN addgroup -S fairwinds && adduser -S -G fairwinds fairwinds
USER fairwinds
COPY --from=build-env /go/src/github.com/reactiveops/fairwinds/fairwinds .
RUN addgroup -S polaris && adduser -S -G polaris polaris
USER polaris
COPY --from=build-env /go/src/github.com/reactiveops/polaris/polaris .

WORKDIR /opt/app

COPY --from=build-env /go/src/github.com/reactiveops/fairwinds/config.yaml ./config.yaml
COPY --from=build-env /go/src/github.com/reactiveops/polaris/config.yaml ./config.yaml

CMD ["fairwinds"]
CMD ["polaris"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
helm-to-k8s:
helm template deploy/helm/fairwinds/ --name fairwinds --namespace fairwinds --set templateOnly=true > deploy/dashboard.yaml
helm template deploy/helm/fairwinds/ --name fairwinds --namespace fairwinds --set templateOnly=true --set webhook.enable=true --set dashboard.enable=false > deploy/webhook.yaml
helm template deploy/helm/polaris/ --name polaris --namespace polaris --set templateOnly=true > deploy/dashboard.yaml
helm template deploy/helm/polaris/ --name polaris --namespace polaris --set templateOnly=true --set webhook.enable=true --set dashboard.enable=false > deploy/webhook.yaml
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
<p align="center">
<img src="/pkg/dashboard/assets/images/logo.png" alt="Fairwinds Logo" />
<img src="/pkg/dashboard/assets/images/logo.png" alt="Polaris Logo" />
</p>

Fairwinds keeps your cluster sailing smoothly. It runs a variety of checks to ensure that Kubernetes deployments are configured using best practices that will avoid potential problems in the future. The project includes two primary parts:
Polaris keeps your cluster sailing smoothly. It runs a variety of checks to ensure that Kubernetes deployments are configured using best practices that will avoid potential problems in the future. The project includes two primary parts:

- A dashboard to display the results of these validations on your existing deployments
- A beta version of a webhook that can prevent poorly configured deployments from reaching your cluster

## Dashboard

The Fairwinds Dashboard provides an overview of your current deployments in a cluster along with their validation scores. An overall score is provided for a cluster on a 0 - 100 scale. Results are then broken down by namespace and deployment.
The Polaris Dashboard provides an overview of your current deployments in a cluster along with their validation scores. An overall score is provided for a cluster on a 0 - 100 scale. Results are then broken down by namespace and deployment.

<p align="center">
<img src="/dashboard-screenshot.png" alt="Fairwinds Dashboard" />
<img src="/dashboard-screenshot.png" alt="Polaris Dashboard" />
</p>

### Deploying

To deploy Fairwinds with kubectl:
To deploy Polaris with kubectl:

```
kubectl apply -f https://raw.githubusercontent.com/reactiveops/fairwinds/master/deploy/dashboard.yaml
kubectl apply -f https://raw.githubusercontent.com/reactiveops/polaris/master/deploy/dashboard.yaml
```

Fairwinds can also be deployed with Helm:
Polaris can also be deployed with Helm:

```
helm upgrade --install fairwinds deploy/helm/fairwinds/ --namespace fairwinds
helm upgrade --install polaris deploy/helm/polaris/ --namespace polaris
```

### Viewing the Dashboard

Once the dashboard is deployed, it can be viewed by using kubectl port-forward:

```
kubectl port-forward --namespace fairwinds svc/fairwinds-dashboard 8080:80
kubectl port-forward --namespace polaris svc/polaris-dashboard 8080:80
```

With the port forwarding in place, you can open http://localhost:8080 in your browser to view the dashboard.

### Using a Binary Release

If you'd prefer to run Fairwinds locally, binary releases are available on the [releases page](https://github.com/reactiveops/fairwinds/releases). When running as a binary, Fairwinds will use your local kubeconfig to connect to a cluster. There are a variety of options available, but the most common usage may be to view the dashboard:
If you'd prefer to run Polaris locally, binary releases are available on the [releases page](https://github.com/reactiveops/polaris/releases). When running as a binary, Polaris will use your local kubeconfig to connect to a cluster. There are a variety of options available, but the most common usage may be to view the dashboard:

```
fairwinds --dashboard
polaris --dashboard
```

## Webhook

Fairwinds includes experimental support for an optional validating webhook. This accepts the same configuration as the dashboard, and can run the same validations. This webhook will reject any deployments that trigger a validation error. This is indicative of the greater goal of Fairwinds, not just to encourage better configuration through dashboard visibility, but to actually enforce it with this webhook. *Although we are working towards greater stability and better test coverage, we do not currently consider this webhook component production ready.*
Polaris includes experimental support for an optional validating webhook. This accepts the same configuration as the dashboard, and can run the same validations. This webhook will reject any deployments that trigger a validation error. This is indicative of the greater goal of Polaris, not just to encourage better configuration through dashboard visibility, but to actually enforce it with this webhook. *Although we are working towards greater stability and better test coverage, we do not currently consider this webhook component production ready.*

Unfortunately we have not found a way to disply warnings as part of `kubectl` output unless we are rejecting a deployment altogether. That means that any checks with a severity of `warning` will still pass webhook validation, and the only evidence of that warning will either be in the Fairwinds dashboard or the Fairwinds webhook logs.
Unfortunately we have not found a way to disply warnings as part of `kubectl` output unless we are rejecting a deployment altogether. That means that any checks with a severity of `warning` will still pass webhook validation, and the only evidence of that warning will either be in the Polaris dashboard or the Polaris webhook logs.

### Deploying

The Fairwinds webhook can be deployed with kubectl:
The Polaris webhook can be deployed with kubectl:

```
kubectl apply -f https://raw.githubusercontent.com/reactiveops/fairwinds/master/deploy/webhook.yaml
kubectl apply -f https://raw.githubusercontent.com/reactiveops/polaris/master/deploy/webhook.yaml
```

Alternatively, the webhook can be enabled with Helm by setting `webhook.enable` to true:

```
helm upgrade --install fairwinds deploy/helm/fairwinds/ --namespace fairwinds --set webhook.enable=true
helm upgrade --install polaris deploy/helm/polaris/ --namespace polaris --set webhook.enable=true
```


## Configuration

Fairwinds supports a wide range of validations covering a number of Kubernetes best practices. Here's a sample configuration file that includes all currently supported checks. The [default configuration](https://github.com/reactiveops/fairwinds/blob/master/config.yaml) contains a number of those checks. This repository also includes a sample [full configuration file](https://github.com/reactiveops/fairwinds/blob/master/config-full.yaml) that enables all available checks.
Polaris supports a wide range of validations covering a number of Kubernetes best practices. Here's a sample configuration file that includes all currently supported checks. The [default configuration](https://github.com/reactiveops/polaris/blob/master/config.yaml) contains a number of those checks. This repository also includes a sample [full configuration file](https://github.com/reactiveops/polaris/blob/master/config-full.yaml) that enables all available checks.

Each check can be assigned a `severity`. Only checks with a severity of `error` or `warning` will be validated. The results of these validations are visible on the dashboard. In the case of the validating webhook, only failures with a severity of `error` will result in a change being rejected.

Fairwinds validation checks fall into several different categories:
Polaris validation checks fall into several different categories:

- [Health Checks](docs/health-checks.md)
- [Images](docs/images.md)
Expand All @@ -84,8 +84,8 @@ Fairwinds validation checks fall into several different categories:

## CLI Options

* `config`: Specify a location for the Fairwinds config
* `dashboard`: Runs the webserver for Fairwinds dashboard.
* `config`: Specify a location for the Polaris config
* `dashboard`: Runs the webserver for Polaris dashboard.
* `dashboard-port`: Port for the dashboard webserver (default 8080)
* `webhook`: Runs the webhook webserver.
* `webhook-port`: Port for the webhook webserver (default 9876)
Expand Down
76 changes: 38 additions & 38 deletions deploy/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
# Source: fairwinds/templates/namespace.yaml
# Source: polaris/templates/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: fairwinds
name: polaris
---
# Source: fairwinds/templates/configmap.yaml
# Source: polaris/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: fairwinds
namespace: fairwinds
name: polaris
namespace: polaris
labels:
app: fairwinds
app: polaris
data:
config.yaml: |
resources:
Expand Down Expand Up @@ -59,23 +59,23 @@ data:
- AUDIT_WRITE

---
# Source: fairwinds/templates/serviceaccount.yaml
# Source: polaris/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: fairwinds
namespace: fairwinds
name: polaris
namespace: polaris
labels:
app: fairwinds
app: polaris

---
# Source: fairwinds/templates/clusterrole.yaml
# Source: polaris/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: fairwinds
name: polaris
labels:
app: fairwinds
app: polaris
rules:
- apiGroups:
- ''
Expand All @@ -86,73 +86,73 @@ rules:
verbs:
- '*'
---
# Source: fairwinds/templates/clusterrolebinding.yaml
# Source: polaris/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: fairwinds
name: polaris
labels:
app: fairwinds
app: polaris
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: fairwinds
name: polaris
subjects:
- kind: ServiceAccount
name: fairwinds
namespace: fairwinds
name: polaris
namespace: polaris
---
# Source: fairwinds/templates/dashboard.service.yaml
# Source: polaris/templates/dashboard.service.yaml
apiVersion: v1
kind: Service
metadata:
name: fairwinds-dashboard
namespace: fairwinds
name: polaris-dashboard
namespace: polaris
labels:
app: fairwinds
app: polaris
spec:
ports:
- name: dashboard
port: 80
protocol: TCP
targetPort: 8080
selector:
app: fairwinds
app: polaris
component: dashboard
type: ClusterIP
---
# Source: fairwinds/templates/dashboard.deployment.yaml
# Source: polaris/templates/dashboard.deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
checksum/config: '5702aca235561630172c22b6b900f5cebd4e82fae60389df18a3537ff82e2f09'
name: fairwinds-dashboard
namespace: fairwinds
checksum/config: '0d7a7837e74d9179b13cade94ee8f6c11b32920f3c6223fc623da850cd399b42'
name: polaris-dashboard
namespace: polaris
labels:
app: fairwinds
app: polaris
component: dashboard
spec:
replicas: 1
selector:
matchLabels:
app: fairwinds
app: polaris
component: dashboard
template:
metadata:
labels:
app: fairwinds
app: polaris
component: dashboard
spec:
volumes:
- name: config
configMap:
name: fairwinds
name: polaris
containers:
- command:
- fairwinds
- polaris
- --dashboard
image: 'quay.io/reactiveops/fairwinds:master'
image: 'quay.io/reactiveops/polaris:master'
imagePullPolicy: 'Always'
name: dashboard
ports:
Expand Down Expand Up @@ -181,13 +181,13 @@ spec:
mountPath: /opt/app/config.yaml
subPath: config.yaml
readOnly: true
serviceAccountName: fairwinds
serviceAccountName: polaris
---
# Source: fairwinds/templates/secret.yaml
# Source: polaris/templates/secret.yaml

---
# Source: fairwinds/templates/webhook.deployment.yaml
# Source: polaris/templates/webhook.deployment.yaml

---
# Source: fairwinds/templates/webhook.service.yaml
# Source: polaris/templates/webhook.service.yaml

7 changes: 0 additions & 7 deletions deploy/helm/fairwinds/templates/serviceaccount.yaml

This file was deleted.

Loading