Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ark server & minio to heptio-ark-server ns #322

Merged
merged 2 commits into from
Feb 21, 2018

Conversation

ncdc
Copy link
Contributor

@ncdc ncdc commented Feb 20, 2018

Move ark server deployment & minio deployment to a separate namespace
from the backups/schedules/restores/config because backups now have a
finalizer. If everything lives in one namespace, you have to delete all
the backups and wait for the GC controller to process them and remove the
finalizer from each before deleting the namespace.

By moving the server into a separate namespace, users can now delete the
heptio-ark namespace the normal way (kubectl delete), and once that
namespace is fully removed, they can delete the heptio-ark-server
namespace.

Signed-off-by: Andy Goldstein andy.goldstein@gmail.com

@ncdc ncdc assigned nrb and skriss Feb 20, 2018
@ncdc
Copy link
Contributor Author

ncdc commented Feb 20, 2018

Still need to update the docs, as they say you can just kubectl delete -f examples/common, which is still going to be a problem for the moment.

@ncdc ncdc force-pushed the run-server-in-separate-ns branch from 9841bba to c4278fb Compare February 20, 2018 15:18
@ncdc
Copy link
Contributor Author

ncdc commented Feb 20, 2018

Docs updated

Copy link
Contributor

@Bradamant3 Bradamant3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Prior" makes me cringe, but it works. Saving the fiddly stuff for another time :-)

@ncdc ncdc force-pushed the run-server-in-separate-ns branch from c4278fb to 820c6f2 Compare February 20, 2018 15:22
@ncdc
Copy link
Contributor Author

ncdc commented Feb 20, 2018

Prior -> Before

@nrb
Copy link
Contributor

nrb commented Feb 20, 2018

Haven't run this yet, but does this somewhat nullify running Ark in any namespace? It's more like the backups are now managed in any namespace and the server will always run in heptio-ark-server, isn't it?

These questions are more clarifying docs and terminology than the code.

@ncdc
Copy link
Contributor Author

ncdc commented Feb 20, 2018

@nrb not exactly. You can run the server in whatever namespace you want (assuming you adjust the yaml appropriately). And you can point the server at whatever namespace you want for the backups/schedules/restores/config. I debated renaming the --namespace flag for ark server to something like --backup-namespace, but I don't think that name is entirely clear about its purpose, plus that only mentions backups and not the rest of the custom resources.

This again highlights the need for a simple way to put the server in 1 ns and the backups etc in another one. Something like ark server install --server-namespace foo --data-namespace bar could do it.

@ncdc
Copy link
Contributor Author

ncdc commented Feb 20, 2018

@Bradamant3 looks like I probably should update docs/namespace.yaml too, since we now have 2 namespaces to possibly change instead of 1.

@nrb
Copy link
Contributor

nrb commented Feb 20, 2018

Credentials namespace in https://github.com/heptio/ark/blob/master/docs/aws-config.md would need to be changed.

e.g.

kubectl create secret generic cloud-credentials \
    --namespace <ARK_NAMESPACE> \
    --from-file cloud=credentials-ark

The secret needs to be in heptio-ark-server or wherever the server is.

@ncdc
Copy link
Contributor Author

ncdc commented Feb 20, 2018

@nrb correct, thanks for pointing that out

files, changing `heptio-ark` to your desired namespace.

NOTE: it is strongly advised that you run the Ark server in its own namespace, separate from the
namespace where your backups, schedules, restores, and config live. If you don't, you may not be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edit:
WARNING: It is recommended to run the Ark server in one namespace, and your backups, schedules, restores, and config in a different namespace. You might encounter issues with deleting a single Ark namespace that runs everything.
(edits for clarity only)

@Bradamant3
Copy link
Contributor

one edit for clarity, otherwise /lgtm

@ncdc ncdc force-pushed the run-server-in-separate-ns branch from 68526f8 to 65d3934 Compare February 20, 2018 16:25
@ncdc
Copy link
Contributor Author

ncdc commented Feb 20, 2018

Thanks, I've updated (with a minor edit to your suggestion).

@Bradamant3
Copy link
Contributor

/lgtm (yeah, I tripped a bit over that wording, didn't I?)

name: ark
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io

---
apiVersion: rbac.authorization.k8s.io/v1beta1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why's the RBAC stuff going away?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because our service account has cluster-admin (granted above)

@nrb nrb added the Bug label Feb 20, 2018
Move ark server deployment & minio deployment to a separate namespace
from the backups/schedules/restores/config because backups now have a
finalizer. If everything lives in one namespace, you have to delete all
the backups and wait for the GC controller to process them and remove the
finalizer from each before deleting the namespace.

By moving the server into a separate namespace, users can now delete the
heptio-ark namespace the normal way (kubectl delete), and once that
namespace is fully removed, they can delete the heptio-ark-server
namespace.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
@ncdc ncdc force-pushed the run-server-in-separate-ns branch from 65d3934 to 08d4fc8 Compare February 20, 2018 17:41
To store your backups, schedules, restores, and config in another namespace, you edit the relevant
files, changing `heptio-ark` to your desired namespace.

WARNING: It is recommended to run the Ark server in one namespace, and place your backups, schedules,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that someone could still end up "stuck" if they remove Ark in the wrong way (i.e. delete the server NS first), it'd probably be helpful to add an entry to the Troubleshooting section in the docs about what to do if that happens (including your cmd @ncdc ?)

Also, @Bradamant3 can we add a link to the GH pages site near the top of the README? How do folks find it otherwise?

@skriss
Copy link
Contributor

skriss commented Feb 20, 2018

Did some testing on GKE and code/config changes LGTM. One other observation is that using the jq snippet from @ncdc to remove finalizers doesn't seem to work if there's only a single backup.

@ncdc
Copy link
Contributor Author

ncdc commented Feb 20, 2018

Oh that's probably because it returns/prints a single one instead of a list

@ncdc
Copy link
Contributor Author

ncdc commented Feb 20, 2018

We can use kubectl -n heptio-ark get backup instead of ark backup get and it will always return a list

@skriss
Copy link
Contributor

skriss commented Feb 20, 2018

yep, confirmed that works

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
@ncdc ncdc changed the title [WIP] Move ark server & minio to heptio-ark-server ns Move ark server & minio to heptio-ark-server ns Feb 21, 2018
@Bradamant3
Copy link
Contributor

LGTM

@ncdc
Copy link
Contributor Author

ncdc commented Feb 21, 2018

Going to merge as-is and @Bradamant3 will submit a follow-up for any additional docs edits.

@ncdc ncdc merged commit 2bc8c52 into vmware-tanzu:master Feb 21, 2018
@ncdc ncdc deleted the run-server-in-separate-ns branch March 5, 2018 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants