Skip to content

Commit

Permalink
Merge pull request #56 from SomtochiAma/dashboard-readme
Browse files Browse the repository at this point in the history
Readme for dashboard operator and updates stable version
  • Loading branch information
k8s-ci-robot authored May 15, 2020
2 parents bf5ffe8 + f477452 commit 657eb5b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 11 deletions.
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.

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

0 comments on commit 657eb5b

Please sign in to comment.