Skip to content

Commit cff0215

Browse files
author
JENNIFER RONDEAU
committed
add rbac content, rework get-started for NodePort and publicUrl, add versioning information
Signed-off-by: JENNIFER RONDEAU <[email protected]>
1 parent 75566c6 commit cff0215

6 files changed

+116
-5
lines changed

docs/quickstart.md docs/get-started.md

+52-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ The following example sets up the Ark server and client, then backs up and resto
44

55
For simplicity, the example uses Minio, an S3-compatible storage service that runs locally on your cluster.
66

7-
**NOTE** The example lets you explore basic Ark functionality. In the real world, however, you would back your cluster up to external storage.
7+
**NOTE** The example lets you explore basic Ark functionality. Configuring Minio for production is out of scope.
88

9-
See [Set up Ark on your platform][3] for how to configure Ark for a production environment.
9+
See [Set up Ark on your platform][3] for how to configure Ark for a production environment.
1010

1111
### Prerequisites
1212

@@ -26,7 +26,9 @@ NOTE: Make sure to check out the appropriate version. We recommend that you chec
2626

2727
### Set up server
2828

29-
1. Start the server and the local storage service. In the root directory of Ark, run:
29+
These instructions start the Ark server and a Minio instance that is accessible from within the cluster only. See the following section for information about configuring your cluster for outside access to Minio. Outside access is required to access logs and run `ark describe` commands.
30+
31+
1. Start the server and the local storage service. In the root directory of Ark, run:
3032

3133
```bash
3234
kubectl apply -f examples/common/00-prereqs.yaml
@@ -46,6 +48,53 @@ NOTE: Make sure to check out the appropriate version. We recommend that you chec
4648
kubectl get deployments --namespace=nginx-example
4749
```
4850

51+
### (Optional) Expose Minio outside your cluster
52+
53+
When you run commands to get logs or describe a backup, the Ark server generates a pre-signed URL to download the requested items. To access these URLs from outside the cluster -- that is, from your Ark client -- you need to make Minio available outside the cluster. You can:
54+
55+
- Change the Minio Service type from `ClusterIP` to `NodePort`.
56+
- Set up Ingress for your cluster, keeping Minio Service type `ClusterIP`.
57+
58+
In Ark 0.10, you can also specify the value of a new `publicUrl` field for the pre-signed URL in your backup storage config.
59+
60+
#### Expose Minio with Service of type NodePort
61+
62+
The Minio deployment by default specifies a Service of type `ClusterIP`. You can change this to `NodePort` to easily expose a cluster service externally if you can reach the node from your Ark client.
63+
64+
You must also get the Minio URL, which you can then specify as the value of the new `publicUrl` field in your backup storage config.
65+
66+
1. In `examples/minio/00-minio-deployment.yaml`, change the value of Service `spec.type` from `ClusterIP` to `NodePort`.
67+
68+
1. Get the Minio URL:
69+
70+
- if you're running Minikube:
71+
72+
```shell
73+
minikube service minio --namespace=heptio-ark --url
74+
```
75+
76+
- in any other environment:
77+
78+
1. Get the value of an external IP address or DNS name of any node in your cluster. You must be able to reach this address from the Ark client.
79+
80+
1. Append the value of the NodePort to get a complete URL. You can get this value by running:
81+
82+
```shell
83+
kubectl -n heptio-ark get svc/minio -o jsonpath='{.spec.ports[0].nodePort}'
84+
```
85+
86+
1. In `examples/minio/05-ark-backupstoragelocation.yaml`, uncomment the `publicUrl` line and provide this Minio URL as the value of the `publicUrl` field. You must include the `http://` or `https://` prefix.
87+
88+
#### Work with Ingress
89+
90+
Configuring Ingress for your cluster is out of scope for the Ark documentation. If you have already set up Ingress, however, it makes sense to continue with it while you run the example Ark configuration with Minio.
91+
92+
In this case:
93+
94+
1. Keep the Service type as `ClusterIP`.
95+
96+
1. In `examples/minio/05-ark-backupstoragelocation.yaml`, uncomment the `publicUrl` line and provide the URL and port of your Ingress as the value of the `publicUrl` field.
97+
4998
### Install client
5099
51100
[Download the client][26].

docs/rbac.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Run Ark more securely with restrictive RBAC settings
2+
3+
By default Ark runs with an RBAC policy of ClusterRole `cluster-admin`. This is to make sure that Ark can back up or restore anything in your cluster. But `cluster-admin` access is wide open -- it gives Ark components access to everything in your cluster. Depending on your environment and your security needs, you should consider whether to configure additional RBAC policies with more restrictive access.
4+
5+
**Note:** Roles and RoleBindings are associated with a single namespaces, not with an entire cluster. PersistentVolume backups are associated only with an entire cluster. This means that any backups or restores that use a restrictive Role and RoleBinding pair can manage only the resources that belong to the namespace. You do not need a wide open RBAC policy to manage PersistentVolumes, however. You can configure a ClusterRole and ClusterRoleBinding that allow backups and restores only of PersistentVolumes, not of all objects in the cluster.
6+
7+
For more information about RBAC and access control generally in Kubernetes, see the Kubernetes documentation about [access control][1], [managing service accounts][2], and [RBAC authorization][3].
8+
9+
## Set up Roles and RoleBindings
10+
11+
Here's a sample Role and RoleBinding pair.
12+
13+
```yaml
14+
apiVersion: rbac.authorization.k8s.io/v1
15+
kind: Role
16+
metadata:
17+
namespace: YOUR_NAMESPACE_HERE
18+
name: ROLE_NAME_HERE
19+
labels:
20+
component: ark
21+
rules:
22+
- apiGroups:
23+
- ark.heptio.com
24+
verbs:
25+
- "*"
26+
resources:
27+
- "*"
28+
```
29+
30+
```yaml
31+
apiVersion: rbac.authorization.k8s.io/v1
32+
kind: RoleBinding
33+
metadata:
34+
name: ROLEBINDING_NAME_HERE
35+
subjects:
36+
- kind: ServiceAccount
37+
name: YOUR_SERVICEACCOUNT_HERE
38+
roleRef:
39+
kind: Role
40+
name: ROLE_NAME_HERE
41+
apiGroup: rbac.authorization.k8s.io
42+
```
43+
44+
[1]: https://kubernetes.io/docs/reference/access-authn-authz/controlling-access/
45+
[2]: https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/
46+
[3]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/
47+
[4]: namespace.md

docs/troubleshooting.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Alternatively, you might be able to use the Service's `spec.loadBalancerIP` fiel
5050
### Ark reports `custom resource not found` errors when starting up.
5151

5252
Ark's server will not start if the required Custom Resource Definitions are not found in Kubernetes. Apply
53-
the `examples/common/00-prereqs.yaml` file to create these defintions, then restart Ark.
53+
the `examples/common/00-prereqs.yaml` file to create these definitions, then restart Ark.
5454

5555
### `ark backup logs` returns a `SignatureDoesNotMatch` error
5656

@@ -68,4 +68,5 @@ Here are some things to verify if you receive `SignatureDoesNotMatch` errors:
6868
[2]: debugging-install.md
6969
[4]: https://github.com/heptio/ark/issues
7070
[5]: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html
71-
[25]: https://kubernetes.slack.com/messages/ark-dr
71+
[25]: https://kubernetes.slack.com/messages/ark-dr
72+
[26]: get-started.md#minikube-configuration

docs/versions.md

+8
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,13 @@ Breaking changes are documented in the release notes and in the documentation.
1414

1515
- See [Upgrading to version 0.10.0][2]
1616

17+
## Ark versions and Kubernetes versions
18+
19+
Not all Ark versions support all versions of Kubernetes. You should be aware of the following known limitations:
20+
21+
- Ark version 0.9.0 requires Kubernetes version 1.8 or later. In version 0.9.1, Ark was updated to support earlier versions.
22+
- Restic support requires Kubernetes version 1.10 or later, or an earlier version with the mount propagation feature enabled. See [Restic Integration][3].
23+
1724
[1]: https://github.com/heptio/ark/releases
1825
[2]: upgrading-to-v0.10.md
26+
[3]: restic.md

examples/minio/00-minio-deployment.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ metadata:
6363
labels:
6464
component: minio
6565
spec:
66+
# ClusterIP is recommended for production environments.
67+
# Change to NodePort if needed per documentation,
68+
# but only if you run Minio in a test/trial environment, for example with Minikube.
6669
type: ClusterIP
6770
ports:
6871
- port: 9000

examples/minio/05-ark-backupstoragelocation.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ spec:
2626
region: minio
2727
s3ForcePathStyle: "true"
2828
s3Url: http://minio.heptio-ark.svc:9000
29+
# Uncomment the following line and provide the value of an externally
30+
# available URL for downloading logs, running Ark describe, and more.
31+
# publicUrl: https://minio.mycluster.com
2932

3033

0 commit comments

Comments
 (0)