Skip to content

Instantly share code, notes, and snippets.

@hickeyma
Last active September 19, 2018 16:30
Show Gist options
  • Save hickeyma/401176702ab0d43b96fa917ee38d1be5 to your computer and use it in GitHub Desktop.
Save hickeyma/401176702ab0d43b96fa917ee38d1be5 to your computer and use it in GitHub Desktop.

Lab 4. Easy Configuration

How do I deploy the same application but configured dirrectly?

1. Configuration using Kubernetes directly

In this part of the lab we show how to deploy the previous application differently, using Kubernetes directly.

  1. Edit the service to have a NodePort type

    Edit (service)[https://github.ibm.com/martin-hickey/helm101-workshop/blob/master/Lab1/service.yaml] making the change in bold as follows:

    piVersion: v1
    

kind: Service metadata: name: myapp labels: app.kubernetes.io/name: myapp app.kubernetes.io/instance: myapp spec: type: NodePort ports: - port: 80 targetPort: http protocol: TCP name: http selector: app.kubernetes.io/name: myapp app.kubernetes.io/instance: myapp

2. 

# 2. Revision management using Helm

In this part of the lab we illustrate revision management on the deployed application `mychartapp`, using Helm.

1. Check the number of deployments

 ```$ helm history mychartapp```
 
 You should see output similar to the following:
 
 ```console
 REVISION	UPDATED                 	STATUS    	CHART           	DESCRIPTION
 1       	Wed Sep 19 16:38:07 2018	SUPERSEDED	mychartapp-0.1.0	Install complete
 2       	Wed Sep 19 16:38:50 2018	DEPLOYED	mychartapp-0.1.0	Upgrade complete
 ```
     
2. Rollback to previous revision

 ```$ helm rollback mychartapp 1```
 
 The output should be similar to the following:
 
 ```console
 Rollback was a success! Happy Helming!
 ```
 Check the history again, ```$ helm history mychartapp```
 
 You should see output similar to the following:
 
 ```console
 REVISION	UPDATED                 	STATUS    	CHART           	DESCRIPTION     
 1       	Wed Sep 19 16:38:07 2018	SUPERSEDED	mychartapp-0.1.0	Install complete
 2       	Wed Sep 19 16:38:50 2018	SUPERSEDED	mychartapp-0.1.0	Upgrade complete
 3       	Wed Sep 19 16:39:31 2018	DEPLOYED  	mychartapp-0.1.0	Rollback to 1
 ```

# 3. Conclusion

What can I say but Helm does revision management well!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment