Giter Club home page Giter Club logo

day-one-helm's Introduction

Day One of Helm

start

install helm chart in OSX

brew install kubernetes-helm

helm init

ckim-mbp:~ ckim$ cd PycharmProjects/day-one-helm/
ckim-mbp:day-one-helm ckim$ helm init --history-max 200
Creating /Users/ckim/.helm
Creating /Users/ckim/.helm/repository
Creating /Users/ckim/.helm/repository/cache
Creating /Users/ckim/.helm/repository/local
Creating /Users/ckim/.helm/plugins
Creating /Users/ckim/.helm/starters
Creating /Users/ckim/.helm/cache/archive
Creating /Users/ckim/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /Users/ckim/.helm.

Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.

Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.
To prevent this, run `helm init` with the --tiller-tls-verify flag.
For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
ckim-mbp:day-one-helm ckim$
ckim-mbp:day-one-helm ckim$ kubectl get pods --all-namespaces -l app=helm
NAMESPACE     NAME                             READY   STATUS    RESTARTS   AGE
kube-system   tiller-deploy-7f598f888c-mt459   1/1     Running   0          6m31s
ckim-mbp:day-one-helm ckim$

add account information

ckim-mbp:day-one-helm ckim$ kubectl create serviceaccount --namespace kube-system tiller
serviceaccount/tiller created
ckim-mbp:day-one-helm ckim$ kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller-cluster-rule created
ckim-mbp:day-one-helm ckim$ kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
deployment.extensions/tiller-deploy patched
ckim-mbp:day-one-helm ckim$
ckim-mbp:day-one-helm ckim$ helm install stable/mysql

ckim-mbp:day-one-helm ckim$ helm ls
NAME                    REVISION        UPDATED                         STATUS          CHART           APP VERSION     NAMESPACE
honking-ladybird        1               Mon Jul 15 13:45:52 2019        DEPLOYED        mysql-1.3.0     5.7.14          default
ckim-mbp:day-one-helm ckim$

this is towards Local Persistent Volumes (GA in 1.14), but not used

ckim-mbp:day-one-helm ckim$ kubectl apply -f files/sc1.yaml
storageclass.storage.k8s.io/local-storage created
ckim-mbp:day-one-helm ckim$ kubectl get storageclass --all-namespaces
NAME            PROVISIONER                    AGE
local-storage   kubernetes.io/no-provisioner   6s
ckim-mbp:day-one-helm ckim$
ckim-mbp:day-one-helm ckim$ kubectl apply -f files/pv1.yaml
persistentvolume/pv0001 created
ckim-mbp:day-one-helm ckim$ kubectl get pv --all-namespaces
NAME     CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS    REASON   AGE
pv0001   8Gi        RWO            Delete           Available           local-storage            7s
ckim-mbp:day-one-helm ckim$ kubectl get pvc --all-namespaces
NAMESPACE   NAME                     STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
default     honking-ladybird-mysql   Pending                                                     84m
ckim-mbp:day-one-helm ckim$

help chart

ckim-mbp:day-one-helm ckim$ helm create day-one-chart
Creating day-one-chart
ckim-mbp:day-one-helm ckim$ ll day-one-chart/
total 24
drwxr-xr-x  7 ckim  staff   224 Jul 15 15:42 ./
drwxr-xr-x  8 ckim  staff   256 Jul 15 15:43 ../
-rw-r--r--  1 ckim  staff   342 Jul 15 15:42 .helmignore
-rw-r--r--  1 ckim  staff   109 Jul 15 15:42 Chart.yaml
drwxr-xr-x  2 ckim  staff    64 Jul 15 15:42 charts/
drwxr-xr-x  8 ckim  staff   256 Jul 15 15:42 templates/
-rw-r--r--  1 ckim  staff  1105 Jul 15 15:42 values.yaml
ckim-mbp:day-one-helm ckim$

start a chart

ckim-mbp:day-one-helm ckim$ helm install --name doc day-one-chart
NAME:   doc
LAST DEPLOYED: Mon Jul 15 16:34:09 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/Deployment
NAME               READY  UP-TO-DATE  AVAILABLE  AGE
doc-day-one-chart  0/1    1           0          2s

==> v1/Pod(related)
NAME                                READY  STATUS             RESTARTS  AGE
doc-day-one-chart-7756d646df-5tj67  0/1    ContainerCreating  0         2s
doc-day-one-chart-test-connection   0/1    Completed          0         3m20s

==> v1/Service
NAME               TYPE       CLUSTER-IP   EXTERNAL-IP  PORT(S)  AGE
doc-day-one-chart  ClusterIP  10.96.12.40  <none>       80/TCP   2s


NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=day-one-chart,app.kubernetes.io/instance=doc" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl port-forward $POD_NAME 8080:80

ckim-mbp:day-one-helm ckim$

status of the chart

ckim-mbp:day-one-helm ckim$ helm ls
NAME    REVISION        UPDATED                         STATUS          CHART                   APP VERSION     NAMESPACE
doc     1               Mon Jul 15 16:34:09 2019        DEPLOYED        day-one-chart-0.1.0     1.0             default
ckim-mbp:day-one-helm ckim$
ckim-mbp:day-one-helm ckim$ kubectl get all -l app.kubernetes.io/instance=doc
NAME                                     READY   STATUS    RESTARTS   AGE
pod/doc-day-one-chart-7756d646df-lbngr   1/1     Running   0          8m32s

NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)   AGE
service/doc-day-one-chart   ClusterIP   10.104.104.148   <none>        80/TCP    8m32s

NAME                                DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/doc-day-one-chart   1         1         1            1           8m32s

NAME                                           DESIRED   CURRENT   READY   AGE
replicaset.apps/doc-day-one-chart-7756d646df   1         1         1       8m32s
ckim-mbp:day-one-helm ckim$

test chart

ckim-mbp:day-one-helm ckim$ helm test doc --cleanup
RUNNING: doc-day-one-chart-test-connection
PASSED: doc-day-one-chart-test-connection
ckim-mbp:day-one-helm ckim$

delete the chart

ckim-mbp:day-one-helm ckim$ helm delete doc --purge
release "doc" deleted
ckim-mbp:day-one-helm ckim$

wordpress example - failed

ckim-mbp:day-one-helm ckim$ helm install --name wp stable/wordpress

ckim-mbp:day-one-helm ckim$ helm ls
NAME    REVISION        UPDATED                         STATUS          CHART                   APP VERSION     NAMESPACE
wp      1               Mon Jul 15 16:52:24 2019        DEPLOYED        wordpress-5.13.1        5.2.2           default
ckim-mbp:day-one-helm ckim$
ckim-mbp:day-one-helm ckim$ helm test wp --cleanup
RUNNING: wp-credentials-test
FAILED: wp-credentials-test, run `kubectl logs wp-credentials-test --namespace default` for more info
RUNNING: wp-mariadb-test-htqi4

ckim-mbp:day-one-helm ckim$ helm delete wp --purge
release "wp" deleted
ckim-mbp:day-one-helm ckim$

day-one-helm's People

Contributors

ckim730 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.