You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that this is overwritting the kubectl that comes with k3s. That is a special version that reads its config from /etc/rancher/k3s/k3s.yaml and must therefore be run with sudo. The version we are installing here is the standard version that reads its config from $HOME/.kube/config.
82
82
83
-
```bash
84
83
### Configure kubectl
85
84
86
-
kubectl uses a default configuration file **$HOME/.kube/config** to connect to the cluster. Here we will copy the configuration file from the server to the workstation.
85
+
kubectl uses a default configuration file **$HOME/.kube/config** to connect to the cluster. Here we will copy the configuration file from the server to the workstation.
87
86
88
87
If you have one machine only then copy the k3s kubectl configuration into your home directory:
Inside of our new namespace we will create a service account that will be used to run the IOCs. Kubernetes uses a declarative model where you define the desired state of the system and Kubernetes will make it so. Here we will create a service account and a secret that will be used to authenticate the service account. In both cases these are defined directly using command line YAML which kubectl passes to the Kubernetes API.
152
-
153
-
Create the account:
154
-
155
-
```bash
156
-
kubectl apply -f - <<EOF
157
-
apiVersion: v1
158
-
kind: ServiceAccount
159
-
metadata:
160
-
name: bl03t-priv
161
-
EOF
162
-
```
163
-
164
-
Generate a login token for the account:
165
-
166
-
```bash
167
-
kubectl apply -f - <<EOF
168
-
apiVersion: v1
169
-
kind: Secret
170
-
metadata:
171
-
name: bl03t-priv-secret
172
-
annotations:
173
-
kubernetes.io/service-account.name: bl03t-priv
174
-
type: kubernetes.io/service-account-token
175
-
EOF
176
-
```
177
-
178
148
### Completed
179
149
180
150
That's it. You now have installed the necessary software to start experimenting with IOCs on Kubernetes.
0 commit comments