github.com/defensepoint-snyk-test/helm-new@v0.0.0-20211130153739-c57ea64d6603/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 58 ``` 59 60 This will install Tiller into the Kubernetes cluster you saw with 61 `kubectl config current-context`. 62 63 **TIP:** Want to install into a different cluster? Use the 64 `--kube-context` flag. 65 66 **TIP:** When you want to upgrade Tiller, just run `helm init --upgrade`. 67 68 By default, when Tiller is installed, it does not have authentication enabled. 69 To learn more about configuring strong TLS authentication for Tiller, consult 70 [the Tiller TLS guide](tiller_ssl.md). 71 72 ## Install an Example Chart 73 74 To install a chart, you can run the `helm install` command. Helm has 75 several ways to find and install a chart, but the easiest is to use one 76 of the official `stable` charts. 77 78 ```console 79 $ helm repo update # Make sure we get the latest list of charts 80 $ helm install stable/mysql 81 NAME: wintering-rodent 82 LAST DEPLOYED: Thu Oct 18 14:21:18 2018 83 NAMESPACE: default 84 STATUS: DEPLOYED 85 86 RESOURCES: 87 ==> v1/Secret 88 NAME AGE 89 wintering-rodent-mysql 0s 90 91 ==> v1/ConfigMap 92 wintering-rodent-mysql-test 0s 93 94 ==> v1/PersistentVolumeClaim 95 wintering-rodent-mysql 0s 96 97 ==> v1/Service 98 wintering-rodent-mysql 0s 99 100 ==> v1beta1/Deployment 101 wintering-rodent-mysql 0s 102 103 ==> v1/Pod(related) 104 105 NAME READY STATUS RESTARTS AGE 106 wintering-rodent-mysql-6986fd6fb-988x7 0/1 Pending 0 0s 107 108 109 NOTES: 110 MySQL can be accessed via port 3306 on the following DNS name from within your cluster: 111 wintering-rodent-mysql.default.svc.cluster.local 112 113 To get your root password run: 114 115 MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default wintering-rodent-mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo) 116 117 To connect to your database: 118 119 1. Run an Ubuntu pod that you can use as a client: 120 121 kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never -- bash -il 122 123 2. Install the mysql client: 124 125 $ apt-get update && apt-get install mysql-client -y 126 127 3. Connect using the mysql cli, then provide your password: 128 $ mysql -h wintering-rodent-mysql -p 129 130 To connect to your database directly from outside the K8s cluster: 131 MYSQL_HOST=127.0.0.1 132 MYSQL_PORT=3306 133 134 # Execute the following command to route the connection: 135 kubectl port-forward svc/wintering-rodent-mysql 3306 136 137 mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u root -p${MYSQL_ROOT_PASSWORD} 138 139 ``` 140 141 In the example above, the `stable/mysql` chart was released, and the name of 142 our new release is `wintering-rodent`. You get a simple idea of the 143 features of this MySQL chart by running `helm inspect stable/mysql`. 144 145 Whenever you install a chart, a new release is created. So one chart can 146 be installed multiple times into the same cluster. And each can be 147 independently managed and upgraded. 148 149 The `helm install` command is a very powerful command with many 150 capabilities. To learn more about it, check out the [Using Helm 151 Guide](using_helm.md) 152 153 ## Learn About Releases 154 155 It's easy to see what has been released using Helm: 156 157 ```console 158 $ helm ls 159 NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE 160 wintering-rodent 1 Thu Oct 18 15:06:58 2018 DEPLOYED mysql-0.10.1 5.7.14 default 161 ``` 162 163 The `helm list` function will show you a list of all deployed releases. 164 165 ## Uninstall a Release 166 167 To uninstall a release, use the `helm delete` command: 168 169 ```console 170 $ helm delete wintering-rodent 171 release "wintering-rodent" deleted 172 ``` 173 174 This will uninstall `wintering-rodent` from Kubernetes, but you will 175 still be able to request information about that release: 176 177 ```console 178 $ helm status wintering-rodent 179 LAST DEPLOYED: Thu Oct 18 14:21:18 2018 180 NAMESPACE: default 181 STATUS: DELETED 182 183 NOTES: 184 MySQL can be accessed via port 3306 on the following DNS name from within your cluster: 185 wintering-rodent-mysql.default.svc.cluster.local 186 187 To get your root password run: 188 189 MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default wintering-rodent-mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo) 190 191 To connect to your database: 192 193 1. Run an Ubuntu pod that you can use as a client: 194 195 kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never -- bash -il 196 197 2. Install the mysql client: 198 199 $ apt-get update && apt-get install mysql-client -y 200 201 3. Connect using the mysql cli, then provide your password: 202 $ mysql -h wintering-rodent-mysql -p 203 204 To connect to your database directly from outside the K8s cluster: 205 MYSQL_HOST=127.0.0.1 206 MYSQL_PORT=3306 207 208 # Execute the following command to route the connection: 209 kubectl port-forward svc/wintering-rodent-mysql 3306 210 211 mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u root -p${MYSQL_ROOT_PASSWORD} 212 ``` 213 214 Because Helm tracks your releases even after you've deleted them, you 215 can audit a cluster's history, and even undelete a release (with `helm 216 rollback`). 217 218 ## Reading the Help Text 219 220 To learn more about the available Helm commands, use `helm help` or type 221 a command followed by the `-h` flag: 222 223 ```console 224 $ helm get -h 225 ```