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

Readme for dashboard operator and updates stable version #56

Merged
merged 2 commits into from
May 15, 2020
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
65 changes: 65 additions & 0 deletions dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This is a simple guide for building an operator with kubebuilder version 2

## 1. Create a folder
```bash
mkdir dashboard
cd dashboard
```

## 2. Enable kubebuilder plugins and init
```bash
export KUBEBUILDER_ENABLE_PLUGINS=1
kubebuilder init --fetch-deps=false --domain=x-k8s.io --license=apache2
kubebuilder create api --pattern=addon --controller=true --example=false --group=addons --kind=Dashboard --make=false
--namespaced=true --resource=true --version=v1alpha1
```

## 3. Run go mod vendor:

```bash
go mod vendor
```

## 3. Delete unnecessary test files
Delete the test suites that are checking that kubebuilder is working:

```bash
find . -name "*_test.go" -delete
```

# Determine the stable version and include its manifest:

Make a directory under `channels/packages/dashboard` for a stable version of the dashboard -- then download the manifest for it:
```bash
mkdir -p channels/packages/dashboard/2.0.0
wget -O channels/packages/dashboard/2.0.0/manifest.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
```


Define the stable channel:

```bash
cat > channels/stable <<EOF
manifests:
- version: 2.0.0
EOF
```

Running the operator locally:

```bash
make install
make run
```
Logs from the operator appear in the console.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's one more thing we can help the reader understand :)

Suggested change
Now in another terminal, create an instance of the Dashboard custom resource:
```bash
kubectl create ns kubernetes-dashboard
kubectl -n kubernetes-dashboard apply -f config/samples/addons_v1alpha1_dashboard.yaml
```
You should see the operator respond and apply the resources from your package.

Now in another terminal, create an instance of the Dashboard custom resource:
```bash
kubectl create ns kubernetes-dashboard
kubectl -n kubernetes-dashboard apply -f config/samples/addons_v1alpha1_dashboard.yaml
```
You should see the operator respond and apply the resources from your package.

You can now continue to build your operator by following the [kubebuilder-declarative-pattern](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/tree/master/docs/addon/walkthrough#misc)


20 changes: 10 additions & 10 deletions dashboard/channels/packages/dashboard/2.0.0/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ spec:
spec:
containers:
- name: kubernetes-dashboard
image: kubernetesui/dashboard:v2.0.0-rc3
image: kubernetesui/dashboard:v2.0.0
imagePullPolicy: Always
ports:
- containerPort: 8443
Expand Down Expand Up @@ -271,7 +271,7 @@ spec:
spec:
containers:
- name: dashboard-metrics-scraper
image: kubernetesui/metrics-scraper:v1.0.3
image: kubernetesui/metrics-scraper:v1.0.4
ports:
- containerPort: 8000
protocol: TCP
Expand Down Expand Up @@ -315,14 +315,14 @@ spec:
Kubernetes Dashboard is a general purpose, web-based UI for Kubernetes clusters.
It allows users to manage applications running in the cluster and troubleshoot them, as well as manage the cluster itself.
icons:
- src: "https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png"
type: "image/png"
- src: "https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png"
type: "image/png"
maintainers:
- name: Maintainer
url: https://github.com/kubernetes/dashboard
- name: Maintainer
url: https://github.com/kubernetes/dashboard
keywords:
- "addon"
- "dashboard"
- "addon"
- "dashboard"
links:
- description: Project Homepage
url: "https://github.com/kubernetes/dashboard"
- description: Project Homepage
url: "https://github.com/kubernetes/dashboard"
2 changes: 1 addition & 1 deletion dashboard/channels/stable
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Versions for the stable channel
manifests:
- version: 1.8.3
- version: 2.0.0