-
Notifications
You must be signed in to change notification settings - Fork 0
/
contextualization.tex
148 lines (116 loc) · 3.75 KB
/
contextualization.tex
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
\label{part_contextualization}
\part{Contextualization}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Contextualization}
\framesubtitle{What is it?}
A way to
\begin{itemize}
\item inject user credentials on boot
\item perform simple configuration tasks
\item customize generic images on boot
\item pass arbitrary data into virtual machine instances
\end{itemize}
\hfill\\
\textbf{NOT} a way to
\begin{itemize}
\item transfer large amounts of data
\item perform complex or interactive tasks
\item replace orchestration or provisioning tools
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Contextualization}
\framesubtitle{How it works?}
\begin{enumerate}
\item Data is passed to the instance at boot
\item The instance is expected to use it
\item Implementation is usually platform-specific
\item There are attempts to "standardize" the process
\end{enumerate}
\hfill\\
\textbf{Delivery mechanisms}: custom-made scripts, direct injection, metadata services, contextualization disks
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Contextualization}
\framesubtitle{Using \textit{cloud-init}}
\begin{itemize}
\item \textit{De facto} standard for multi-platform contextualization
\item Supports multiple delivery mechanisms $\rightarrow$ "datasources"
\item Offers implementations of commonly performed tasks $\rightarrow$ "modules"
\item Configuration in the form of a YAML file $\rightarrow$ "user\_data"
\end{itemize}
\hfill\\
For details, see \href{http://cloudinit.readthedocs.org/en/latest/index.html}{\nolinkurl{http://cloudinit.readthedocs.org/en/latest/index.html}}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Contextualization}
\framesubtitle{Using provisioning}
\begin{itemize}
\item Advanced task automation and parallelization
\item Typically using a declarative approach
\item Slow start, considerable advantages later on
\item Preferred method for the cloud environment
\end{itemize}
\hfill \\
\textbf{Tools}: puppet, chef, ansible, salt, CFEngine, \dots
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Contextualization}
\framesubtitle{Usage example -- Simple}
\begin{lstlisting}
#cloud-config
groups:
- cloud-users
users:
- name: cloudman
gecos: Cloud H. Man
sudo: ALL=(ALL) NOPASSWD:ALL
groups: cloud-users, admin
lock-passwd: true
ssh-authorized-keys:
- <ssh pub key 1>
- <ssh pub key 2>
\end{lstlisting}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Contextualization}
\framesubtitle{Usage example -- Advanced}
\begin{lstlisting}
#cloud-config
mounts:
- [vdc,/data,ext4]
package_upgrade: true
packages:
- qemu-guest-agent
phone_home:
url: http://my.master.org/instances/$INSTANCE_ID
post: [ pub_key_rsa, instance_id ]
final_message: "The system is ready!"
\end{lstlisting}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Contextualization}
\framesubtitle{Usage example -- Provisioning}
\begin{lstlisting}
#cloud-config
puppet:
conf:
agent:
server: "my.master.org"
certname: "%i.%f"
ca_cert: |
-----BEGIN CERTIFICATE-----
... omitted ...
-----END CERTIFICATE-----
\end{lstlisting}
\end{frame}
%%% Local Variables:
%%% TeX-master: "2014-05-23_Best_Practices"
%%% End: