4
4
Setup a Kubernetes Server
5
5
=========================
6
6
7
- .. Warning ::
8
-
9
- This information is out of date. It will be updated soon.
10
7
11
8
.. Note ::
12
9
13
- **DLS Users **: DLS already has the test cluster Pollux and further
14
- beamline and machine clusters are coming soon.
15
-
16
- To use the Pollux cluster, run ``module load pollux `` outside of the
17
- devcontainer and then run the script ``.devcontainer/dls-copy-k8s-crt.sh ``
10
+ **DLS Users **: DLS already has the test cluster Pollux which includes
11
+ the test beamline p46 and the training beamlines p46 through to p49.
18
12
19
- The Pollux Cluster already has a beamline namespace ``bl01t ``
20
- for you to use as a training area. *You will need
21
- to ask SciComp to add you as a user of this namespace. *
22
- Please be aware that this is a shared resource so others might be using
23
- it at the same time.
13
+ We have also started to roll out production clusters for some of our
14
+ beamlines. To date we have clusters for p38, i20, i22 and c01.
24
15
25
- The Pollux Cluster already has the Kubernetes dashboard installed.
26
- To access it go to http://pollux.diamond.ac.uk and click
27
- ``Pollux K8S Dashboard ``.
28
-
29
- Then select ``bl01t `` from the namespace drop down menu in the top left,
30
- to see the training namespace.
16
+ For this reason DLS users should skip this tutorial unless you have a
17
+ spare linux machine with root access and an interest in how Clusters
18
+ are created.
31
19
32
20
Introduction
33
21
------------
@@ -39,7 +27,7 @@ Bring Your Own Cluster
39
27
----------------------
40
28
41
29
If you already have a Kubernetes cluster then you can skip this section.
42
- and go straight to ` ./create_beamline ` .
30
+ and go straight to the next tutorial .
43
31
44
32
IMPORTANT: you will require appropriate permissions on the cluster to work
45
33
with epics-containers. In particular you will need to be able to create
@@ -137,17 +125,18 @@ uses a namespace for each beamline or accelerator domain.
137
125
A context is a combination of a cluster, namespace, and user. It tells kubectl
138
126
which cluster and namespace to use when communicating with the Kubernetes API.
139
127
140
- So here we will create a namespace for our first test beamline BEAMLINE TEST 01
141
- or bl01t for short. We will also create a context for this namespace and set
142
- it as the default context.
128
+ Here we will create a namespace for our first test beamline bl45p. We are
129
+ using this name because it is the name of the first ever Kubernetes beamline
130
+ at DLS. This just means I can use some of the following tutorials for both
131
+ DLS and non-DLS users.
143
132
144
133
From the workstation INSIDE the devcontainer execute the following:
145
134
146
135
.. code-block :: bash
147
136
148
- kubectl create namespace bl01t
149
- kubectl config set-context bl01t --namespace=bl01t --user=default --cluster=default
150
- kubectl config use-context bl01t
137
+ kubectl create namespace bl45p
138
+ kubectl config set-context bl45p --namespace=bl45p --user=default --cluster=default
139
+ kubectl config use-context bl45p
151
140
152
141
Create a service account to run the IOCs
153
142
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -163,7 +152,7 @@ Create the account:
163
152
apiVersion: v1
164
153
kind: ServiceAccount
165
154
metadata:
166
- name: bl01t -priv
155
+ name: bl45p -priv
167
156
EOF
168
157
169
158
Generate a login token for the account:
@@ -174,9 +163,9 @@ Generate a login token for the account:
174
163
apiVersion: v1
175
164
kind: Secret
176
165
metadata:
177
- name: bl01t -priv-secret
166
+ name: bl45p -priv-secret
178
167
annotations:
179
- kubernetes.io/service-account.name: bl01t -priv
168
+ kubernetes.io/service-account.name: bl45p -priv
180
169
type: kubernetes.io/service-account-token
181
170
EOF
182
171
@@ -195,3 +184,4 @@ simply use this command:
195
184
k3s-uninstall.sh
196
185
197
186
If you are interested in looking at the k3s files see **/var/lib/rancher/k3s/**.
187
+
0 commit comments