github.com/koderover/helm@v2.17.0+incompatible/docs/quickstart.md (about)

     1  # Quickstart Guide
     2  
     3  This guide covers how you can quickly get started using Helm.
     4  
     5  ## Prerequisites
     6  
     7  The following prerequisites are required for a successful and properly secured use of Helm.
     8  
     9  1. A Kubernetes cluster
    10  2. Deciding what security configurations to apply to your installation, if any
    11  3. Installing and configuring Helm and Tiller, the cluster-side service.
    12  
    13  
    14  ### Install Kubernetes or have access to a cluster
    15  - You must have Kubernetes installed. For the latest release of Helm, we recommend the latest stable release of Kubernetes, which in most cases is the second-latest minor release.
    16  - You should also have a local configured copy of `kubectl`.
    17  
    18  NOTE: Kubernetes versions prior to 1.6 have limited or no support for role-based access controls (RBAC).
    19  
    20  Helm will figure out where to install Tiller by reading your Kubernetes
    21  configuration file (usually `$HOME/.kube/config`). This is the same file
    22  that `kubectl` uses.
    23  
    24  To find out which cluster Tiller would install to, you can run
    25  `kubectl config current-context` or `kubectl cluster-info`.
    26  
    27  ```console
    28  $ kubectl config current-context
    29  my-cluster
    30  ```
    31  
    32  ### Understand your Security Context
    33  
    34  As with all powerful tools, ensure you are installing it correctly for your scenario.
    35  
    36  If you're using Helm on a cluster that you completely control, like minikube or a cluster on a private network in which sharing is not a concern, the default installation -- which applies no security configuration -- is fine, and it's definitely the easiest. To install Helm without additional security steps, [install Helm](#Install-Helm) and then [initialize Helm](#initialize-helm-and-install-tiller).
    37  
    38  However, if your cluster is exposed to a larger network or if you share your cluster with others -- production clusters fall into this category -- you must take extra steps to secure your installation to prevent careless or malicious actors from damaging the cluster or its data. To apply configurations that secure Helm for use in production environments and other multi-tenant scenarios, see [Securing a Helm installation](securing_installation.md)
    39  
    40  If your cluster has Role-Based Access Control (RBAC) enabled, you may want
    41  to [configure a service account and rules](rbac.md) before proceeding.
    42  
    43  ## Install Helm
    44  
    45  Download a binary release of the Helm client. You can use tools like
    46  `homebrew`, or look at [the official releases page](https://github.com/helm/helm/releases).
    47  
    48  For more details, or for other options, see [the installation
    49  guide](install.md).
    50  
    51  ## Initialize Helm and Install Tiller
    52  
    53  Once you have Helm ready, you can initialize the local CLI and also
    54  install Tiller into your Kubernetes cluster in one step:
    55  
    56  ```console
    57  $ helm init --history-max 200
    58  ```
    59  
    60  **TIP:** Setting `--history-max` on helm init is recommended as configmaps and other objects in helm history can grow large in number if not purged by max limit. Without a max history set the history is kept indefinitely, leaving a large number of records for helm and tiller to maintain.
    61  
    62  This will install Tiller into the Kubernetes cluster you saw with
    63  `kubectl config current-context`.
    64  
    65  **TIP:** Want to install into a different cluster? Use the
    66  `--kube-context` flag.
    67  
    68  **TIP:** When you want to upgrade Tiller, just run `helm init --upgrade`.
    69  
    70  By default, when Tiller is installed, it does not have authentication enabled.
    71  To learn more about configuring strong TLS authentication for Tiller, consult
    72  [the Tiller TLS guide](tiller_ssl.md).
    73  
    74  ## Install an Example Chart
    75  
    76  To install a chart, you can run the `helm install` command. Helm has
    77  several ways to find and install a chart, but the easiest is to use one
    78  of the official `stable` charts.
    79  
    80  ```console
    81  $ helm repo update              # Make sure we get the latest list of charts
    82  $ helm install stable/mysql
    83  NAME:   wintering-rodent
    84  LAST DEPLOYED: Thu Oct 18 14:21:18 2018
    85  NAMESPACE: default
    86  STATUS: DEPLOYED
    87  
    88  RESOURCES:
    89  ==> v1/Secret
    90  NAME                    AGE
    91  wintering-rodent-mysql  0s
    92  
    93  ==> v1/ConfigMap
    94  wintering-rodent-mysql-test  0s
    95  
    96  ==> v1/PersistentVolumeClaim
    97  wintering-rodent-mysql  0s
    98  
    99  ==> v1/Service
   100  wintering-rodent-mysql  0s
   101  
   102  ==> v1beta1/Deployment
   103  wintering-rodent-mysql  0s
   104  
   105  ==> v1/Pod(related)
   106  
   107  NAME                                    READY  STATUS   RESTARTS  AGE
   108  wintering-rodent-mysql-6986fd6fb-988x7  0/1    Pending  0         0s
   109  
   110  
   111  NOTES:
   112  MySQL can be accessed via port 3306 on the following DNS name from within your cluster:
   113  wintering-rodent-mysql.default.svc.cluster.local
   114  
   115  To get your root password run:
   116  
   117      MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default wintering-rodent-mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo)
   118  
   119  To connect to your database:
   120  
   121  1. Run an Ubuntu pod that you can use as a client:
   122  
   123      kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never -- bash -il
   124  
   125  2. Install the mysql client:
   126  
   127      $ apt-get update && apt-get install mysql-client -y
   128  
   129  3. Connect using the mysql cli, then provide your password:
   130      $ mysql -h wintering-rodent-mysql -p
   131  
   132  To connect to your database directly from outside the K8s cluster:
   133      MYSQL_HOST=127.0.0.1
   134      MYSQL_PORT=3306
   135  
   136      # Execute the following command to route the connection:
   137      kubectl port-forward svc/wintering-rodent-mysql 3306
   138  
   139      mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u root -p${MYSQL_ROOT_PASSWORD}
   140  
   141  ```
   142  
   143  In the example above, the `stable/mysql` chart was released, and the name of
   144  our new release is `wintering-rodent`. You get a simple idea of the
   145  features of this MySQL chart by running `helm inspect stable/mysql`.
   146  
   147  Whenever you install a chart, a new release is created. So one chart can
   148  be installed multiple times into the same cluster. And each can be
   149  independently managed and upgraded.
   150  
   151  The `helm install` command is a very powerful command with many
   152  capabilities. To learn more about it, check out the [Using Helm
   153  Guide](using_helm.md)
   154  
   155  ## Learn About Releases
   156  
   157  It's easy to see what has been released using Helm:
   158  
   159  ```console
   160  $ helm ls
   161  NAME            	REVISION	UPDATED                 	STATUS  	CHART       	APP VERSION	NAMESPACE
   162  wintering-rodent	1       	Thu Oct 18 15:06:58 2018	DEPLOYED	mysql-0.10.1	5.7.14     	default
   163  ```
   164  
   165  The `helm list` function will show you a list of all deployed releases.
   166  
   167  ## Uninstall a Release
   168  
   169  To uninstall a release, use the `helm delete` command:
   170  
   171  ```console
   172  $ helm delete wintering-rodent
   173  release "wintering-rodent" deleted
   174  ```
   175  
   176  This will uninstall `wintering-rodent` from Kubernetes, but you will
   177  still be able to request information about that release:
   178  
   179  ```console
   180  $ helm status wintering-rodent
   181  LAST DEPLOYED: Thu Oct 18 14:21:18 2018
   182  NAMESPACE: default
   183  STATUS: DELETED
   184  
   185  NOTES:
   186  MySQL can be accessed via port 3306 on the following DNS name from within your cluster:
   187  wintering-rodent-mysql.default.svc.cluster.local
   188  
   189  To get your root password run:
   190  
   191      MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default wintering-rodent-mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo)
   192  
   193  To connect to your database:
   194  
   195  1. Run an Ubuntu pod that you can use as a client:
   196  
   197      kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never -- bash -il
   198  
   199  2. Install the mysql client:
   200  
   201      $ apt-get update && apt-get install mysql-client -y
   202  
   203  3. Connect using the mysql cli, then provide your password:
   204      $ mysql -h wintering-rodent-mysql -p
   205  
   206  To connect to your database directly from outside the K8s cluster:
   207      MYSQL_HOST=127.0.0.1
   208      MYSQL_PORT=3306
   209  
   210      # Execute the following command to route the connection:
   211      kubectl port-forward svc/wintering-rodent-mysql 3306
   212  
   213      mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u root -p${MYSQL_ROOT_PASSWORD}
   214  ```
   215  
   216  Because Helm tracks your releases even after you've deleted them, you
   217  can audit a cluster's history, and even undelete a release (with `helm
   218  rollback`).
   219  
   220  ## Reading the Help Text
   221  
   222  To learn more about the available Helm commands, use `helm help` or type
   223  a command followed by the `-h` flag:
   224  
   225  ```console
   226  $ helm get -h
   227  ```