|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * security/zero_trust_workload_identity_manageer/zero-trust-manager-configuration.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="zero-trust-manager-spire-agent-config_{context}"] |
| 7 | += Deploying the SPIRE agent |
| 8 | + |
| 9 | +You can configure the `SpireAgent` custom resource (CR) to deploy and configure a SPIRE agent. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* You have access to the cluster as a user with the `cluster-admin` role. |
| 14 | +
|
| 15 | +* You have installed {zero-trust-full} in the cluster. |
| 16 | +
|
| 17 | +.Procedure |
| 18 | + |
| 19 | +. Create the `SpireAgent` CR: |
| 20 | + |
| 21 | +.. Create a YAML file that defines the `SpireAgent` CR, for example, `SpireAgent.yaml`: |
| 22 | ++ |
| 23 | +.Example `SpireAgent.yaml` |
| 24 | ++ |
| 25 | +[source,yaml] |
| 26 | +---- |
| 27 | +apiVersion: operator.openshift.io/v1alpha1 |
| 28 | +kind: SpireAgent |
| 29 | +metadata: |
| 30 | + name: cluster |
| 31 | +spec: |
| 32 | + trustDomain: <trust_domain> #<1> |
| 33 | + clusterName: <cluster_name> #<2> |
| 34 | + nodeAttestor: |
| 35 | + k8sPSATEnabled: "true" #<3> |
| 36 | + workloadAttestors: |
| 37 | + k8sEnabled: "true" #<4> |
| 38 | + workloadAttestorsVerification: |
| 39 | + type: "auto" #<5> |
| 40 | +---- |
| 41 | +<1> The trust domain to be used for the SPIFFE identifiers. |
| 42 | +<2> The name of your cluster. |
| 43 | +<3> Enable or disable the projected service account token (PSAT) Kubernetes node attestor. The valid options are `true` and `false`. |
| 44 | +<4> Enable or disable the Kubernetes workload attestor. The valid options are `true` and `false`. |
| 45 | +<5> The type of verification to be done against kubelet. Valid options are `auto`, `hostCert`, `apiServerCA`, `skip`. The `auto` option initially attempts to use `hostCert`, and then falls back to `apiServerCA`. |
| 46 | + |
| 47 | +.. Apply the configuration by running the following command: |
| 48 | ++ |
| 49 | +[source, terminal] |
| 50 | +---- |
| 51 | +$ oc apply -f SpireAgent.yaml |
| 52 | +---- |
| 53 | + |
| 54 | +.Verification |
| 55 | + |
| 56 | +. Verify that the daemon set of the SPIRE agent is ready and available by running the following command |
| 57 | ++ |
| 58 | +[source,terminal] |
| 59 | +---- |
| 60 | +$ oc get daemonset -l app.kubernetes.io/name=agent -n zero-trust-workload-identity-manager |
| 61 | +---- |
| 62 | ++ |
| 63 | +.Example output |
| 64 | +[source,terminal] |
| 65 | +---- |
| 66 | +NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE |
| 67 | +spire-agent 3 3 3 3 3 <none> 10m |
| 68 | +---- |
| 69 | + |
| 70 | +. Verify that the status of SPIRE agent pods is `Running` by running the following command: |
| 71 | ++ |
| 72 | +[source,terminal] |
| 73 | +---- |
| 74 | +$ oc get po -l app.kubernetes.io/name=agent -n zero-trust-workload-identity-manager |
| 75 | +---- |
| 76 | ++ |
| 77 | +.Example output |
| 78 | +[source,terminal] |
| 79 | +---- |
| 80 | +NAME READY STATUS RESTARTS AGE |
| 81 | +spire-agent-dp4jb 1/1 Running 0 12m |
| 82 | +spire-agent-nvwjm 1/1 Running 0 12m |
| 83 | +spire-agent-vtvlk 1/1 Running 0 12m |
| 84 | +---- |
0 commit comments