Answers: <h1>Installing k3s and kubeapps</h1>
  <ol>
  <li><p>Install k3s, (<a href="https://rancher.com/docs/k3s/latest/en/installation/" rel="nofollow noreferrer">official instructions</a>)</p>
  <pre class="lang-sh prettyprint-override"><code>curl -sfL https://get.k3s.io | sh -
  </code></pre>
  </li>
  <li><p>Add <code>KUBECONFIG</code> for user. (<a href="https://devops.stackexchange.com/q/16043/18965">Devops.StackExchange</a>)</p>
  <pre class="lang-sh prettyprint-override"><code>export KUBECONFIG=~/.kube/config
  mkdir ~/.kube 2&gt; /dev/null
  sudo k3s kubectl config view --raw &gt; &quot;$KUBECONFIG&quot;
  chmod 600 &quot;$KUBECONFIG&quot;
  </code></pre>
  </li>
  <li><p>Install Helm, (<a href="https://helm.sh/docs/intro/install/" rel="nofollow noreferrer">offical instructions</a>)</p>
  <pre class="lang-sh prettyprint-override"><code>curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
  </code></pre>
  </li>
  <li><p>Setup Kubeapps, (<a href="https://kubeapps.dev/" rel="nofollow noreferrer">official instructions</a>)</p>
  <ol>
  <li><p>Install Kubeapps</p>
  <pre class="lang-sh prettyprint-override"><code>helm repo add bitnami https://charts.bitnami.com/bitnami
  helm repo update
  helm install -n kubeapps --create-namespace kubeapps bitnami/kubeapps
  </code></pre>
  </li>
  <li><p>Configure Kubeapps</p>
  <pre class="lang-sh prettyprint-override"><code>kubectl create --namespace default serviceaccount kubeapps-operator
  
  kubectl create clusterrolebinding kubeapps-operator --clusterrole=cluster-admin --serviceaccount=default:kubeapps-operator
  
  cat &lt;&lt;EOF | kubectl apply -f -
  apiVersion: v1
  kind: Secret
  metadata:
    name: kubeapps-operator-token
    namespace: default
    annotations:
      kubernetes.io/service-account.name: kubeapps-operator
  type: kubernetes.io/service-account-token
  EOF
  
  kubectl get --namespace default secret kubeapps-operator-token -o jsonpath='{.data.token}' -o go-template='{{.data.token | base64decode}}' &amp;&amp; echo
  </code></pre>
  </li>
  <li><p>Play (note we have a slight modification with <a href="https://devops.stackexchange.com/a/16106/18965"><code>--address 0.0.0.0</code></a>)</p>
  <pre class="lang-sh prettyprint-override"><code>kubectl port-forward -n kubeapps --address 0.0.0.0 svc/kubeapps 8080:80
  </code></pre>
  </li>
  </ol>
  </li>
  </ol>
  <h1>Removal</h1>
  <pre class="lang-sh prettyprint-override"><code>sudo k3s-uninstall.sh
  
  # Remove helm, and caches
  sudo rm -rf /usr/local/bin/helm ~/.cache/helm /root/.cache/helm
  
  # Remove logs
  sudo rm -rf /var/log/pods/
  
  # Your own cluster config/keys/kubeconfig
  sudo rm -rf ~/.kube
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2024-10-06T08:23:44.857Z
Answers: Also add this line to the install instructions ```echo "export KUBECONFIG=~/.kube/config" >> ~/.bashrc``` to automate *KUBECONFIG* finding in each login.
Answers: EsmaeelE
Answers: CC BY-SA 4.0
Answers: 2022-06-08T19:15:00.940Z
Answers: 2022-06-08T21:20:51.143Z
Answers: 2022-06-08T21:20:51.143Z
Answers: Evan Carroll
Body: <p>How can I get an install of KubeApps running on K3s? What are the minimal required steps?</p>
  
Comments: CC BY-SA 4.0
Comments: 2022-06-16T15:29:45.163Z
Comments: What details or clarity is needed here, it's a self answered question?
Comments: Evan Carroll
Tags: <k3s><kubeapps>
Title: How can I get an installation of k3s working with KubeApps?
UserDisplayName: Evan Carroll
ThreadText: # How can I get an installation of k3s working with KubeApps?
  
  (Asked by: username_0 on 2022-06-08)
  
  How can I get an install of KubeApps running on K3s? What are the minimal required steps?
  
  **Tags:** k3s, kubeapps
  
  > **Comments:**
  > **username_0**: What details or clarity is needed here, it's a self answered question?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-06-08. Score: 1 | Accepted answer
  
  # Installing k3s and kubeapps
  
  1. Install k3s, ([official instructions](https://rancher.com/docs/k3s/latest/en/installation/))
  
     ```sh
     curl -sfL https://get.k3s.io | sh -
  
     ```
  2. Add `KUBECONFIG` for user. ([Devops.StackExchange](https://devops.stackexchange.com/q/16043/18965))
  
     ```sh
     export KUBECONFIG=~/.kube/config
     mkdir ~/.kube 2> /dev/null
     sudo k3s kubectl config view --raw > "$KUBECONFIG"
     chmod 600 "$KUBECONFIG"
  
     ```
  3. Install Helm, ([offical instructions](https://helm.sh/docs/intro/install/))
  
     ```sh
     curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
  
     ```
  4. Setup Kubeapps, ([official instructions](https://kubeapps.dev/))
  
     1. Install Kubeapps
  
        ```sh
        helm repo add bitnami https://charts.bitnami.com/bitnami
        helm repo update
        helm install -n kubeapps --create-namespace kubeapps bitnami/kubeapps
  
        ```
     2. Configure Kubeapps
  
        ```sh
        kubectl create --namespace default serviceaccount kubeapps-operator
  
        kubectl create clusterrolebinding kubeapps-operator --clusterrole=cluster-admin --serviceaccount=default:kubeapps-operator
  
        cat <<EOF | kubectl apply -f -
        apiVersion: v1
        kind: Secret
        metadata:
          name: kubeapps-operator-token
          namespace: default
          annotations:
            kubernetes.io/service-account.name: kubeapps-operator
        type: kubernetes.io/service-account-token
        EOF
  
        kubectl get --namespace default secret kubeapps-operator-token -o jsonpath='{.data.token}' -o go-template='{{.data.token | base64decode}}' && echo
  
        ```
     3. Play (note we have a slight modification with [`--address 0.0.0.0`](https://devops.stackexchange.com/a/16106/18965))
  
        ```sh
        kubectl port-forward -n kubeapps --address 0.0.0.0 svc/kubeapps 8080:80
  
        ```
  
  # Removal
  
  ```sh
  sudo k3s-uninstall.sh
  
  # Remove helm, and caches
  sudo rm -rf /usr/local/bin/helm ~/.cache/helm /root/.cache/helm
  
  # Remove logs
  sudo rm -rf /var/log/pods/
  
  # Your own cluster config/keys/kubeconfig
  sudo rm -rf ~/.kube
  
  ```
  
  > **Comments:**
  > **username_1**: Also add this line to the install instructions ```echo "export KUBECONFIG=~/.kube/config" >> ~/.bashrc``` to automate *KUBECONFIG* finding in each login.  
  
  ---
  
  