sassoftware / viya4-deployment

This project contains Ansible code that creates a baseline in an existing Kubernetes environment for use with the SAS Viya Platform, generates the manifest for an order, and then can also deploy that order into the Kubernetes environment specified.
Apache License 2.0
71 stars 64 forks source link

"kustomize - Generate deployment manifest" task fails in orders containing SAS Workload Management #121

Closed hyweldaniels closed 3 years ago

hyweldaniels commented 3 years ago

When an order contains SAS Workload Management, the playbook fails when generating the deployment manifest.

The issue occurs because sas-storageclass.yaml (https://github.com/sassoftware/viya4-deployment/blob/7e89b16edc7369683422b1950dd57a261be320b3/roles/vdm/templates/transformers/sas-storageclass.yaml) attempts to add a Storage Class name to the volumeClaimTemplate for every Stateful Set.

However the sas-workload-orchestrator Stateful Set that comes with SAS Workload Management does not contain a volumeClaimTemplate attribute, leading to a build error;

Error: failed to apply json patch '- op: add
  path: /spec/volumeClaimTemplates/0/spec/storageClassName
  value: sas': add operation does not apply: doc is missing path: "/spec/volumeClaimTemplates/0/spec/storageClassName": missing value

A possible workaround, that I have tested, would be to explicitly exclude sas-workload-orchestrator using an annotation selector;

apiVersion: builtin
kind: PatchTransformer
metadata:
  name: sas-ss-storageclass
patch: |-
  - op: add
    path: /spec/volumeClaimTemplates/0/spec/storageClassName
    value: sas
target:
  group: apps
  kind: StatefulSet
  annotationSelector: sas.com/component-name != sas-workload-orchestrator
thpang commented 3 years ago

Seems like sas-workload-orchestrator needs a volume claim entry. Does it not need storage of any kind?

thpang commented 3 years ago

@hyweldaniels any update here? Again, this is a stateful set which would seem to need a storage component of some type. If that's not the case, maybe the SAS Workload Management needs to have it's classification changed.

jkmin96 commented 3 years ago

When I checked my opensource k8s deployment with all products, I see this PVC:

bash-4.4$ k -n trs get pvc | grep orch sas-workload-orchestrator-share Bound pvc-63d4bc90-a7aa-4e7e-aec1-4ae62abbfa26 2Gi RWX nfs-client 32h

And statefulsets:

bash-4.4$ k -n trs get statefulsets | grep orch sas-workload-orchestrator 2/2 33h

sbralg commented 3 years ago

Heads up. The same happens for component sas-risk-cirrus-search.

We used the following annotationSelector:

annotationSelector: sas.com/component-name notin (sas-workload-orchestrator,sas-risk-cirrus-search)