-
Notifications
You must be signed in to change notification settings - Fork 0
/
03-cicd-pipelines.slide
105 lines (75 loc) · 2.68 KB
/
03-cicd-pipelines.slide
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Production-ready microservices with Go and Kubernetes
#ContainerDays
09:00 18 Jun 2018
Elena Grahovac
elena@grahovac.me
@webdeva
* Local cinfiguration and tools
.link https://ui.k8s.community
* Hello, Kubernetes!
Deploy and expose deployment of your first service:
USER=your_github_user
kubectl run hello-app --image=gcr.io/google-samples/hello-app:1.0 --port=8080 -n ${USER}
kubectl expose deployment hello-app -n ${USER}
* Hello, Kubernetes!
Add ingress (create hello-ingress.yaml file, don'f forget to change namespace):
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: hello-ingress
namespace: rumyantseva
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
tls:
- secretName: tls-secret
hosts:
- services.k8s.community
rules:
- http:
paths:
- path: /rumyantseva/hello
backend:
serviceName: hello-app
servicePort: 8080
host: services.k8s.community
* Hello, Kubernetes!
Apply ingress configuration:
kubectl apply -f hello-ingress.yaml
Check this out:
kubectl get services -n ${USER}
curl -i https://services.k8s.community/${USER}/hello
* Trying CI/CD
- Install GitHub app to allow CI/CD listen to events:
.link https://github.com/apps/k8s
- Create a brunch release/a.b.c (where a.b.c is the same as RELEASE from the Makefile)
- Push something
- CI and CD processes should be started
- If everything is ok your service will be available at
https://services.k8s.community/<username>/<app name>
* Additional tasks
- When your service is released, you can try to play with some other useful kubectl commands.
For example, try to find how to get logs of your application. Try to delete pods and see what happens.
- Try to change something with your current service or release another one.
* Examples
.link https://github.com/kubernetes/charts
.link https://github.com/k8s-community
* Run Kubernetes locally
- install kubectl:
.link https://kubernetes.io/docs/tasks/tools/install-kubectl/
- install minikube:
.link https://kubernetes.io/docs/tasks/tools/install-minikube/
- run: `minikube` `start`
- initialize ingress: `minikube` `addons` `enable` `ingress`
- set context: `kubectl` `config` `use-context` `minikube`
- check: `kubectl` `config` `current-context`
- try dashboard: `minikube` `dashboard`
* Install helm
- install helm:
.link https://docs.helm.sh/using_helm/#installing-the-helm-client
- run: `helm` `init`
- check: `helm` `search`
* Local configuration
- Add additional chart configuration (values file) to be able to release your service locally
* Questions & additional tasks