├── .gitignore ├── LICENSE ├── README.md ├── ca ├── ca-config.json ├── ca-csr.json └── consul-csr.json ├── cleanup ├── clusterroles └── consul.yaml ├── configs └── server.json ├── images └── consul-ui.png ├── serviceaccounts └── consul.yaml ├── services └── consul.yaml └── statefulsets └── consul.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | ca-key.pem 2 | ca.csr 3 | ca.pem 4 | consul-key.pem 5 | consul.csr 6 | consul.pem 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Running Consul on Kubernetes 2 | 3 | This tutorial will walk you through deploying a three (3) node [Consul](https://www.consul.io) cluster on Kubernetes. 4 | 5 | ## Overview 6 | 7 | * Three (3) node Consul cluster using a [StatefulSet](http://kubernetes.io/docs/concepts/abstractions/controllers/statefulsets) 8 | * Secure communication between Consul members using [TLS and encryption keys](https://www.consul.io/docs/agent/encryption.html) 9 | 10 | ## Prerequisites 11 | 12 | This tutorial leverages features available in Kubernetes 1.11.0 and later. 13 | 14 | * [kubernetes](http://kubernetes.io/docs/getting-started-guides/binary_release) 1.11.x 15 | 16 | ``` 17 | gcloud container clusters create consul \ 18 | --cluster-version 1.11.2-gke.9 19 | ``` 20 | 21 | The following clients must be installed on the machine used to follow this tutorial: 22 | 23 | * [consul](https://www.consul.io/downloads.html) 1.4.0-rc 24 | * [cfssl](https://pkg.cfssl.org) and [cfssljson](https://pkg.cfssl.org) 1.2 25 | 26 | ## Usage 27 | 28 | Clone this repo: 29 | 30 | ``` 31 | git clone https://github.com/kelseyhightower/consul-on-kubernetes.git 32 | ``` 33 | 34 | Change into the `consul-on-kubernetes` directory: 35 | 36 | ``` 37 | cd consul-on-kubernetes 38 | ``` 39 | 40 | ### Generate TLS Certificates 41 | 42 | RPC communication between each Consul member will be encrypted using TLS. Initialize a Certificate Authority (CA): 43 | 44 | ``` 45 | cfssl gencert -initca ca/ca-csr.json | cfssljson -bare ca 46 | ``` 47 | 48 | Create the Consul TLS certificate and private key: 49 | 50 | ``` 51 | cfssl gencert \ 52 | -ca=ca.pem \ 53 | -ca-key=ca-key.pem \ 54 | -config=ca/ca-config.json \ 55 | -profile=default \ 56 | ca/consul-csr.json | cfssljson -bare consul 57 | ``` 58 | 59 | At this point you should have the following files in the current working directory: 60 | 61 | ``` 62 | ca-key.pem 63 | ca.pem 64 | consul-key.pem 65 | consul.pem 66 | ``` 67 | 68 | ### Generate the Consul Gossip Encryption Key 69 | 70 | [Gossip communication](https://www.consul.io/docs/internals/gossip.html) between Consul members will be encrypted using a shared encryption key. Generate and store an encrypt key: 71 | 72 | ``` 73 | GOSSIP_ENCRYPTION_KEY=$(consul keygen) 74 | ``` 75 | 76 | ### Create the Consul Secret and Configmap 77 | 78 | The Consul cluster will be configured using a combination of CLI flags, TLS certificates, and a configuration file, which reference Kubernetes configmaps and secrets. 79 | 80 | Store the gossip encryption key and TLS certificates in a Secret: 81 | 82 | ``` 83 | kubectl create secret generic consul \ 84 | --from-literal="gossip-encryption-key=${GOSSIP_ENCRYPTION_KEY}" \ 85 | --from-file=ca.pem \ 86 | --from-file=consul.pem \ 87 | --from-file=consul-key.pem 88 | ``` 89 | 90 | Store the Consul server configuration file in a ConfigMap: 91 | 92 | ``` 93 | kubectl create configmap consul --from-file=configs/server.json 94 | ``` 95 | 96 | ### Create the Consul Service 97 | 98 | Create a headless service to expose each Consul member internally to the cluster: 99 | 100 | ``` 101 | kubectl create -f services/consul.yaml 102 | ``` 103 | 104 | ### Create the Consul Service Account 105 | 106 | ``` 107 | kubectl apply -f serviceaccounts/consul.yaml 108 | ``` 109 | 110 | ``` 111 | kubectl apply -f clusterroles/consul.yaml 112 | ``` 113 | 114 | ### Create the Consul StatefulSet 115 | 116 | Deploy a three (3) node Consul cluster using a StatefulSet: 117 | 118 | ``` 119 | kubectl create -f statefulsets/consul.yaml 120 | ``` 121 | 122 | Each Consul member will be created one by one. Verify each member is `Running` before moving to the next step. 123 | 124 | ``` 125 | kubectl get pods 126 | ``` 127 | ``` 128 | NAME READY STATUS RESTARTS AGE 129 | consul-0 1/1 Running 0 20s 130 | consul-1 1/1 Running 0 20s 131 | consul-2 1/1 Running 0 20s 132 | ``` 133 | 134 | ### Verification 135 | 136 | At this point the Consul cluster has been bootstrapped and is ready for operation. To verify things are working correctly, review the logs for one of the cluster members. 137 | 138 | ``` 139 | kubectl logs consul-0 140 | ``` 141 | 142 | The consul CLI can also be used to check the health of the cluster. In a new terminal start a port-forward to the `consul-0` pod. 143 | 144 | ``` 145 | kubectl port-forward consul-0 8500:8500 146 | ``` 147 | ``` 148 | Forwarding from 127.0.0.1:8500 -> 8500 149 | Forwarding from [::1]:8500 -> 8500 150 | ``` 151 | 152 | Run the `consul members` command to view the status of each cluster member. 153 | 154 | ``` 155 | consul members 156 | ``` 157 | ``` 158 | Node Address Status Type Build Protocol DC Segment 159 | consul-0 10.32.2.8:8301 alive server 1.4.0rc1 2 dc1 160 | consul-1 10.32.1.7:8301 alive server 1.4.0rc1 2 dc1 161 | consul-2 10.32.0.13:8301 alive server 1.4.0rc1 2 dc1 162 | ``` 163 | 164 | ### Accessing the Web UI 165 | 166 | The Consul UI does not support any form of authentication out of the box so it should not be exposed. To access the web UI, start a port-forward session to the `consul-0` Pod in a new terminal. 167 | 168 | ``` 169 | kubectl port-forward consul-0 8500:8500 170 | ``` 171 | 172 | Visit http://127.0.0.1:8500 in your web browser. 173 | 174 | ![Image of Consul UI](images/consul-ui.png) 175 | 176 | ## Cleanup 177 | 178 | Run the `cleanup` script to remove the Kubernetes resources created during this tutorial: 179 | 180 | ``` 181 | bash cleanup 182 | ``` 183 | -------------------------------------------------------------------------------- /ca/ca-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "expiry": "8760h" 5 | }, 6 | "profiles": { 7 | "default": { 8 | "usages": ["signing", "key encipherment", "server auth", "client auth"], 9 | "expiry": "8760h" 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ca/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosts": [ 3 | "cluster.local" 4 | ], 5 | "key": { 6 | "algo": "rsa", 7 | "size": 2048 8 | }, 9 | "names": [ 10 | { 11 | "C": "US", 12 | "L": "Portland", 13 | "O": "Kubernetes", 14 | "OU": "CA", 15 | "ST": "Oregon" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ca/consul-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "CN": "server.dc1.cluster.local", 3 | "hosts": [ 4 | "server.dc1.cluster.local", 5 | "127.0.0.1" 6 | ], 7 | "key": { 8 | "algo": "rsa", 9 | "size": 2048 10 | }, 11 | "names": [ 12 | { 13 | "C": "US", 14 | "L": "Portland", 15 | "O": "Hightower Labs", 16 | "OU": "Consul", 17 | "ST": "Oregon" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /cleanup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm ca-key.pem ca.csr ca.pem consul-key.pem consul.csr consul.pem 4 | kubectl delete statefulset consul 5 | kubectl delete pvc data-consul-0 data-consul-1 data-consul-2 6 | kubectl delete svc consul 7 | kubectl delete jobs consul-join 8 | kubectl delete secrets consul 9 | kubectl delete configmaps consul 10 | -------------------------------------------------------------------------------- /clusterroles/consul.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: consul 5 | labels: 6 | app: consul 7 | rules: 8 | - apiGroups: [""] 9 | resources: 10 | - pods 11 | verbs: 12 | - get 13 | - list 14 | --- 15 | apiVersion: rbac.authorization.k8s.io/v1 16 | kind: ClusterRoleBinding 17 | metadata: 18 | name: consul 19 | roleRef: 20 | apiGroup: rbac.authorization.k8s.io 21 | kind: ClusterRole 22 | name: consul 23 | subjects: 24 | - kind: ServiceAccount 25 | name: consul 26 | namespace: default 27 | -------------------------------------------------------------------------------- /configs/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "bind_addr": "0.0.0.0", 3 | "ca_file": "/etc/tls/ca.pem", 4 | "cert_file": "/etc/tls/consul.pem", 5 | "client_addr": "0.0.0.0", 6 | "disable_host_node_id": true, 7 | "data_dir": "/consul/data", 8 | "datacenter": "dc1", 9 | "domain": "cluster.local", 10 | "key_file": "/etc/tls/consul-key.pem", 11 | "ports": { 12 | "https": 8443 13 | }, 14 | "retry_join": [ 15 | "provider=k8s label_selector=\"app=consul,component=server\"" 16 | ], 17 | "server": true, 18 | "telemetry": { 19 | "prometheus_retention_time": "5m" 20 | }, 21 | "verify_incoming": true, 22 | "verify_outgoing": true, 23 | "verify_server_hostname": true, 24 | "ui": true 25 | } 26 | -------------------------------------------------------------------------------- /images/consul-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kelseyhightower/consul-on-kubernetes/6a9fefd188c22623161276619e828f0170a3a0f8/images/consul-ui.png -------------------------------------------------------------------------------- /serviceaccounts/consul.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: consul 5 | labels: 6 | app: consul 7 | -------------------------------------------------------------------------------- /services/consul.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: consul 5 | labels: 6 | name: consul 7 | spec: 8 | clusterIP: None 9 | ports: 10 | - name: http 11 | port: 8500 12 | targetPort: 8500 13 | - name: https 14 | port: 8443 15 | targetPort: 8443 16 | - name: rpc 17 | port: 8400 18 | targetPort: 8400 19 | - name: serflan-tcp 20 | protocol: "TCP" 21 | port: 8301 22 | targetPort: 8301 23 | - name: serflan-udp 24 | protocol: "UDP" 25 | port: 8301 26 | targetPort: 8301 27 | - name: serfwan-tcp 28 | protocol: "TCP" 29 | port: 8302 30 | targetPort: 8302 31 | - name: serfwan-udp 32 | protocol: "UDP" 33 | port: 8302 34 | targetPort: 8302 35 | - name: server 36 | port: 8300 37 | targetPort: 8300 38 | - name: consuldns 39 | port: 8600 40 | targetPort: 8600 41 | selector: 42 | app: consul 43 | -------------------------------------------------------------------------------- /statefulsets/consul.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: consul 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: consul 9 | component: server 10 | serviceName: consul 11 | podManagementPolicy: "Parallel" 12 | replicas: 3 13 | template: 14 | metadata: 15 | labels: 16 | app: consul 17 | component: server 18 | annotations: 19 | "consul.hashicorp.com/connect-inject": "false" 20 | spec: 21 | serviceAccountName: consul 22 | affinity: 23 | podAntiAffinity: 24 | requiredDuringSchedulingIgnoredDuringExecution: 25 | - labelSelector: 26 | matchExpressions: 27 | - key: app 28 | operator: In 29 | values: 30 | - consul 31 | topologyKey: kubernetes.io/hostname 32 | terminationGracePeriodSeconds: 10 33 | securityContext: 34 | fsGroup: 1000 35 | containers: 36 | - name: consul 37 | image: "consul:1.4.0-rc1" 38 | env: 39 | - name: POD_IP 40 | valueFrom: 41 | fieldRef: 42 | fieldPath: status.podIP 43 | - name: GOSSIP_ENCRYPTION_KEY 44 | valueFrom: 45 | secretKeyRef: 46 | name: consul 47 | key: gossip-encryption-key 48 | args: 49 | - "agent" 50 | - "-advertise=$(POD_IP)" 51 | - "-bootstrap-expect=3" 52 | - "-config-file=/etc/consul/config/server.json" 53 | - "-encrypt=$(GOSSIP_ENCRYPTION_KEY)" 54 | volumeMounts: 55 | - name: data 56 | mountPath: /consul/data 57 | - name: config 58 | mountPath: /etc/consul/config 59 | - name: tls 60 | mountPath: /etc/tls 61 | lifecycle: 62 | preStop: 63 | exec: 64 | command: 65 | - /bin/sh 66 | - -c 67 | - consul leave 68 | ports: 69 | - containerPort: 8500 70 | name: ui-port 71 | - containerPort: 8400 72 | name: alt-port 73 | - containerPort: 53 74 | name: udp-port 75 | - containerPort: 8443 76 | name: https-port 77 | - containerPort: 8080 78 | name: http-port 79 | - containerPort: 8301 80 | name: serflan 81 | - containerPort: 8302 82 | name: serfwan 83 | - containerPort: 8600 84 | name: consuldns 85 | - containerPort: 8300 86 | name: server 87 | volumes: 88 | - name: config 89 | configMap: 90 | name: consul 91 | - name: tls 92 | secret: 93 | secretName: consul 94 | volumeClaimTemplates: 95 | - metadata: 96 | name: data 97 | spec: 98 | accessModes: 99 | - ReadWriteOnce 100 | resources: 101 | requests: 102 | storage: 10Gi 103 | --------------------------------------------------------------------------------