|
| 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-server-config_{context}"] |
| 7 | += Deploying the SPIRE server |
| 8 | + |
| 9 | +You can configure the `SpireServer` custom resource (CR) to deploy and configure a SPIRE server. |
| 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 `SpireServer` CR: |
| 20 | + |
| 21 | +.. Create a YAML file that defines the `SpireServer` CR, for example, `SpireServer.yaml`: |
| 22 | ++ |
| 23 | +.Example `SpireServer.yaml` |
| 24 | ++ |
| 25 | +[source,yaml] |
| 26 | +---- |
| 27 | +apiVersion: operator.openshift.io/v1alpha1 |
| 28 | +kind: SpireServer |
| 29 | +metadata: |
| 30 | + name: cluster |
| 31 | +spec: |
| 32 | + trustDomain: <trust_domain> #<1> |
| 33 | + clusterName: <cluster_name> #<2> |
| 34 | + caSubject: |
| 35 | + commonName: example.org #<3> |
| 36 | + country: "US" #<4> |
| 37 | + organization: "RH" #<5> |
| 38 | + persistence: |
| 39 | + type: pvc #<6> |
| 40 | + size: "5Gi" #<7> |
| 41 | + accessMode: ReadWriteOnce #<8> |
| 42 | + datastore: |
| 43 | + databaseType: sqlite3 |
| 44 | + connectionString: "/run/spire/data/datastore.sqlite3" |
| 45 | + maxOpenConns: 100 #<9> |
| 46 | + maxIdleConns: 2 #<10> |
| 47 | + connMaxLifetime: 3600 #<11> |
| 48 | + jwtIssuer: <jwt_issuer_domain> #<12> |
| 49 | +---- |
| 50 | +<1> The trust domain to be used for the SPIFFE identifiers. |
| 51 | +<2> The name of your cluster. |
| 52 | +<3> The common name for SPIRE server CA. |
| 53 | +<4> The country for SPIRE server CA. |
| 54 | +<5> The organization for SPIRE server CA. |
| 55 | +<6> The type of volume to be used for persistence. The valid options are `pvc` and `hostPath`. |
| 56 | +<7> The size of volume to be used for persistence |
| 57 | +<8> The access mode to be used for persistence. The valid options are `ReadWriteOnce`, `ReadWriteOncePod`, and `ReadWriteMany`. |
| 58 | +<9> The maximum number of open database connections. |
| 59 | +<10> The maximum number of idle connections in the pool. |
| 60 | +<11> The maximum amount of time a connection can be reused. To specify an unlimited time, you can set the value to `0`. |
| 61 | +<12> The JSON Web Token (JWT) issuer domain. The default value is set to the value specified in `oidc-discovery.$trustDomain`. |
| 62 | + |
| 63 | +.. Apply the configuration by running the following command: |
| 64 | ++ |
| 65 | +[source, terminal] |
| 66 | +---- |
| 67 | +$ oc apply -f SpireServer.yaml |
| 68 | +---- |
| 69 | + |
| 70 | +.Verification |
| 71 | + |
| 72 | +. Verify that the stateful set of SPIRE server is ready and available by running the following command: |
| 73 | ++ |
| 74 | +[source,terminal] |
| 75 | +---- |
| 76 | +$ oc get statefulset -l app.kubernetes.io/name=server -n zero-trust-workload-identity-manager |
| 77 | +---- |
| 78 | ++ |
| 79 | +.Example output |
| 80 | +[source,terminal] |
| 81 | +---- |
| 82 | +NAME READY AGE |
| 83 | +spire-server 1/1 65s |
| 84 | +---- |
| 85 | + |
| 86 | +. Verify that the status of SPIRE server pod is `Running` by running the following command: |
| 87 | ++ |
| 88 | +[source,terminal] |
| 89 | +---- |
| 90 | +$ oc get po -l app.kubernetes.io/name=server -n zero-trust-workload-identity-manager |
| 91 | +---- |
| 92 | ++ |
| 93 | +.Example output |
| 94 | +[source,terminal] |
| 95 | +---- |
| 96 | +NAME READY STATUS RESTARTS AGE |
| 97 | +spire-server-0 2/2 Running 1 (108s ago) 111s |
| 98 | +---- |
| 99 | + |
| 100 | +. Verify that the persistent volume claim (PVC) is bound, by running the following command: |
| 101 | ++ |
| 102 | +[source,terminal] |
| 103 | +---- |
| 104 | +$ oc get pvc -l app.kubernetes.io/name=server -n zero-trust-workload-identity-manager |
| 105 | +---- |
| 106 | ++ |
| 107 | +.Example output |
| 108 | +[source,terminal] |
| 109 | +---- |
| 110 | +NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTECLASS AGE |
| 111 | +spire-data-spire-server-0 Bound pvc-27a36535-18a1-4fde-ab6d-e7ee7d3c2744 5Gi RW0 gp3-csi <unset> 22m |
| 112 | +---- |
0 commit comments