redhat-cop / openshift-applier

Used to apply OpenShift objects to an OpenShift Cluster
Apache License 2.0
102 stars 61 forks source link

Ability to apply a remote directory. #150

Open etsauer opened 4 years ago

etsauer commented 4 years ago

Not sure exactly how we accomplish this one, but here's the use case.

I am often in the situation of wanting to deploy an Operator from a remote git repository. This repo likely does not use applier, and likely has a deploy/ directory containing multiple manifests files required to deploy it.

For example:

[esauer 🎩︎namespace-configuration-operator] (master)$ ls -l deploy/
total 20
drwxrwxr-x. 2 esauer esauer 4096 Aug 26 17:11 crds
-rw-rw-r--. 1 esauer esauer  918 Aug 26 17:11 operator.yaml
-rw-rw-r--. 1 esauer esauer  617 Aug 26 17:11 role_binding.yaml
-rw-rw-r--. 1 esauer esauer  866 Aug 26 17:11 role.yaml
-rw-rw-r--. 1 esauer esauer   87 Aug 26 17:11 service_account.yaml

In order to deploy this using applier, I have to add all of this to my seed-hosts.yml:

  - name: Namespace Config Operator CRD
    file: https://raw.githubusercontent.com/redhat-cop/namespace-configuration-operator/v0.0.1/deploy/crds/redhatcop_v1alpha1_namespaceconfig_crd.yaml
    namespace: namespace-configuration-operator
    tags:
    - project-config
  - name: Namespace Config Operator Role
    file: https://raw.githubusercontent.com/redhat-cop/namespace-configuration-operator/v0.0.1/deploy/role.yaml
    namespace: namespace-configuration-operator
    tags:
    - project-config
  - name: Namespace Config Operator Role Binding
    file: https://raw.githubusercontent.com/redhat-cop/namespace-configuration-operator/v0.0.1/deploy/role_binding.yaml
    namespace: namespace-configuration-operator
    tags:
    - project-config
  - name: Namespace Config Operator Service Account
    file: https://raw.githubusercontent.com/redhat-cop/namespace-configuration-operator/v0.0.1/deploy/service_account.yaml
    namespace: namespace-configuration-operator
    tags:
    - project-config
  - name: Namespace Config Operator Deployment
    file: https://github.com/redhat-cop/namespace-configuration-operator/blob/v0.0.1/deploy/operator.yaml
    namespace: namespace-configuration-operator
    tags:
    - project-config

This gets very verbose, especially when setting up an entire cluster where I am deploying multiple operators. It would be nice to have a more succinct way of doing this. One possibly way would be to find a syntax that would cause applier to clone the directory mentioned and oc apply -f repository/deploy/ it instead.

etsauer commented 4 years ago

Another option might be a shorthand to list multiple file paths in a single content block.