Skip to content

Commit

Permalink
Update docs code blocks chart/kubeapps/readme (#1645)
Browse files Browse the repository at this point in the history
* Remove $ from commands in chart readme so they can be directly copy-pasted

* Swap console to bash since it's just cmds & no output + consistency
  • Loading branch information
tiffanyfay authored Apr 8, 2020
1 parent ddca77d commit 3fefc31
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions chart/kubeapps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ To install the chart with the release name `kubeapps`:

For Helm 2:

```console
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install --name kubeapps --namespace kubeapps bitnami/kubeapps
```bash
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install --name kubeapps --namespace kubeapps bitnami/kubeapps
```

> **IMPORTANT** This assumes an insecure Helm 2 installation, which is not recommended in production. See [the documentation to learn how to secure Helm 2 and Kubeapps in production](https://github.com/kubeapps/kubeapps/blob/master/docs/user/securing-kubeapps.md).
Expand All @@ -73,8 +73,8 @@ For a full list of configuration parameters of the Kubeapps chart, see the [valu

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```console
$ helm install kubeapps --namespace kubeapps \
```bash
helm install kubeapps --namespace kubeapps \
--set assetsvc.service.port=9090 \
bitnami/kubeapps
```
Expand All @@ -83,8 +83,8 @@ The above command sets the port for the assetsvc Service to 9090.

Alternatively, a YAML file that specifies the values for parameters can be provided while installing the chart. For example,

```console
$ helm install kubeapps --namespace kubeapps -f custom-values.yaml bitnami/kubeapps
```bash
helm install kubeapps --namespace kubeapps -f custom-values.yaml bitnami/kubeapps
```

## Configuration and installation details
Expand Down Expand Up @@ -125,8 +125,8 @@ The simplest way to expose the Kubeapps Dashboard is to assign a LoadBalancer ty

Wait for your cluster to assign a LoadBalancer IP or Hostname to the `kubeapps` Service and access it on that address:

```console
$ kubectl get services --namespace kubeapps --watch
```bash
kubectl get services --namespace kubeapps --watch
```

#### Ingress
Expand Down Expand Up @@ -157,15 +157,15 @@ You can upgrade Kubeapps from the Kubeapps web interface. Select the namespace i

You can also use the Helm CLI to upgrade Kubeapps, first ensure you have updated your local chart repository cache:

```console
$ helm repo update
```bash
helm repo update
```

Now upgrade Kubeapps:

```console
$ export RELEASE_NAME=kubeapps
$ helm upgrade $RELEASE_NAME bitnami/kubeapps
```bash
export RELEASE_NAME=kubeapps
helm upgrade $RELEASE_NAME bitnami/kubeapps
```

If you find issues upgrading Kubeapps, check the [troubleshooting](#error-while-upgrading-the-chart) section.
Expand All @@ -174,13 +174,15 @@ If you find issues upgrading Kubeapps, check the [troubleshooting](#error-while-

To uninstall/delete the `kubeapps` deployment:

```console
```bash
# For Helm 2
$ helm delete --purge kubeapps
helm delete --purge kubeapps

# For Helm 3
$ helm uninstall kubeapps
helm uninstall kubeapps

# Optional: Only if there are no more instances of Kubeapps
$ kubectl delete crd apprepositories.kubeapps.com
kubectl delete crd apprepositories.kubeapps.com
```

The first command removes most of the Kubernetes components associated with the chart and deletes the release. After that, if there are no more instances of Kubeapps in the cluster you can manually delete the `apprepositories.kubeapps.com` CRD used by Kubeapps that is shared for the entire cluster.
Expand All @@ -189,8 +191,8 @@ The first command removes most of the Kubernetes components associated with the
If you have dedicated a namespace only for Kubeapps you can completely clean remaining completed/failed jobs or any stale resources by deleting the namespace

```console
$ kubectl delete namespace kubeapps
```bash
kubectl delete namespace kubeapps
```

## Troubleshooting
Expand All @@ -211,7 +213,7 @@ Error: namespaces "kubeapps" is forbidden: User "system:serviceaccount:kube-syst

This usually is an indication that Tiller was not installed with enough permissions to create the resources required by Kubeapps. In order to install Kubeapps, tiller will need to be able to install Custom Resource Definitions cluster-wide, as well as manage app repositories in your kubeapps namespace. The easiest way to enable this in a development environment is install Tiller with elevated permissions (e.g. as a cluster-admin). For example:

```
```bash
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
Expand All @@ -221,14 +223,14 @@ but for a production environment you can assign the specific permissions so that

It is also possible, though less common, that your cluster does not have Role Based Access Control (RBAC) enabled. To check if your cluster has RBAC you can execute:

```console
$ kubectl api-versions
```bash
kubectl api-versions
```

If the above command does not include entries for `rbac.authorization.k8s.io` you should perform the chart installation by setting `rbac.create=false`:

```console
$ helm install --name kubeapps --namespace kubeapps bitnami/kubeapps --set rbac.create=false
```bash
helm install --name kubeapps --namespace kubeapps bitnami/kubeapps --set rbac.create=false
```

### Error while upgrading the Chart
Expand All @@ -239,42 +241,42 @@ It is possible that when upgrading Kubeapps an error appears. That can be caused
1. (Optional) Backup your personal repositories (if you have any):

```console
```bash
kubectl get apprepository --namespace kubeapps -o yaml <repo name> > <repo name>.yaml
```

2. Delete Kubeapps:

```console
```bash
helm del --purge kubeapps
```

3. (Optional) Delete the App Repositories CRD:

> **Warning**: Don't execute this step if you have more than one Kubeapps installation in your cluster.
```console
```bash
kubectl delete crd apprepositories.kubeapps.com
```

4. (Optional) Clean the Kubeapps namespace:

> **Warning**: Don't execute this step if you have workloads other than Kubeapps in the `kubeapps` namespace.
```console
```bash
kubectl delete namespace kubeapps
```

5. Install the latest version of Kubeapps (using any custom modifications you need):

```console
```bash
helm repo update
helm install --name kubeapps --namespace kubeapps bitnami/kubeapps
```

6. (Optional) Restore any repositories you backed up in the first step:

```console
```bash
kubectl apply -f <repo name>.yaml
```

Expand Down

0 comments on commit 3fefc31

Please sign in to comment.