Hi.
On 02/06/2018 13:18, Graham Dumpleton wrote:
For the basic Python application you wouldn't need to export most of
those and for some doing so would cause problems when you try to load
them again.
For a basic application with no secrets, configmaps or persistent
volumes, all you need is:
oc export is,bc,dc,svc,route -o yaml
Just to be on the save site please add cm (=configmap ) and secrets to
the export also, for the future case.
oc export is,bc,dc,svc,route,cm,secrets -o yaml
Do not include pods, replicationcontrollers or endpoints.
You also want to be selective about what you export by using a label
selector.
oc export is,bc,dc,svc,route --selector app=yourappname -o yaml
That way you get just what is necessary for the application.
Before they can be reloaded in a fresh project or OpenShift instance,
you would usually need to massage the result, especially fixing up
image references and reverting them to image stream references.
Overall you are better off to export as a template and edit the result
to create a template you can then deploy multiple times, where the
application name is parameterised.
Full ack, the command looks then like this.
FYI: As always in yaml **don't use TABS**
```
oc export is,bc,dc,svc,route,cm,secrets -o yaml --as-template=MyPersonalTemplate
```
That's the link to the template doc
https://docs.openshift.org/3.9/dev_guide/templates.html
Graham
Best regards
Aleks
On 2 Jun 2018, at 2:01 am, Brian Keyes <[email protected]> wrote:
I am attempting to follow these instructions
https://docs.openshift.com/container-platform/3.7/day_two_guide/project_level_tasks.html
<https://docs.openshift.com/container-platform/3.7/day_two_guide/project_level_tasks.html>
I want to backup THE sample python app and I created a script like this ( from
the documentation)
$ for object in rolebindings serviceaccounts secrets imagestreamtags podpreset
cms egressnetworkpolicies rolebindingrestrictions limitranges resourcequotas
pvcs templates cronjobs statefulsets hpas deployments replicasets
poddisruptionbudget endpoints
do
oc export $object -o yaml > $object.yaml
done
--
but when I run this I get some access denied errors like this , is this saying
that the objects I am attempting to back up do not exist?
$ ./exportotherprojects.sh
error: no resources found - nothing to export
the server doesn't have a resource type "cms"
Error from server (Forbidden): User "admin" cannot list egressnetworkpolicies.network.openshift.io
<http://egressnetworkpolicies.network.openshift.io/> in the namespace "sample-py": User "admin" cannot list
egressnetworkpolicies.network.openshift.io <http://egressnetworkpolicies.network.openshift.io/> in project "sample-py"
(get egressnetworkpolicies.network.openshift.io <http://egressnetworkpolicies.network.openshift.io/>)
error: no resources found - nothing to export
error: no resources found - nothing to export
error: no resources found - nothing to export
the server doesn't have a resource type "pvcs"
error: no resources found - nothing to export
error: no resources found - nothing to export
error: no resources found - nothing to export
the server doesn't have a resource type "hpas"
error: no resources found - nothing to export
error: no resources found - nothing to export
Error from server (Forbidden): User "admin" cannot list poddisruptionbudgets.policy in the namespace
"sample-py": User "admin" cannot list poddisruptionbudgets.policy in project "sample-py"
(get poddisruptionbudgets.policy)
thanks
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users