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

Unable to override resources and tolerations for an operator deployment #1298

Closed
secat opened this issue Feb 18, 2020 · 17 comments
Closed

Unable to override resources and tolerations for an operator deployment #1298

secat opened this issue Feb 18, 2020 · 17 comments
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. triage/unresolved Indicates an issue that can not or will not be resolved.

Comments

@secat
Copy link

secat commented Feb 18, 2020

I am currently unable to override the resources and tolerations field for an operator deployment. According to the subscriptions.operators.coreos.com CRD, there is a field named subscription.spec.config to do so.

I have deployed a subscription CR using the following manifest:

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: tracing-operator-subscription
  namespace: fleet-system
spec:
  channel: preview
  name: tracing-operator
  source: tracing-operator-catalog
  sourceNamespace: fleet-system
  config:
    resources:
      limits:
        memory: 128Mi
      requests:
        cpu: 100m
        memory: 128Mi
    tolerations:
    - key: workload-isolation.infra.fleet
      operator: Equal
      value: default
      effect: NoSchedule

Here is the status:

status:
  catalogHealth:
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: tracing-operator-catalog
      namespace: fleet-system
      resourceVersion: "14510590"
      uid: 1ade9b61-2822-4986-887c-17867048b4e5
    healthy: true
    lastUpdated: "2020-02-18T16:13:29Z"
  conditions:
  - lastTransitionTime: "2020-02-18T16:13:29Z"
    message: all available catalogsources are healthy
    reason: AllCatalogSourcesHealthy
    status: "False"
    type: CatalogSourcesUnhealthy
  currentCSV: tracing-operator.v0.3.0
  installPlanRef:
    apiVersion: operators.coreos.com/v1alpha1
    kind: InstallPlan
    name: install-9wdlk
    namespace: fleet-system
    resourceVersion: "14519056"
    uid: 532649d6-5c9f-4060-be9f-3e83d7b84775
  installedCSV: tracing-operator.v0.3.0
  installplan:
    apiVersion: operators.coreos.com/v1alpha1
    kind: InstallPlan
    name: install-9wdlk
    uuid: 532649d6-5c9f-4060-be9f-3e83d7b84775
  lastUpdated: "2020-02-18T16:13:32Z"
  state: AtLatestKnown

These overrides are missing in the automatic generated installplan CRD.

Here is the generated deployment manifest:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  creationTimestamp: "2020-02-18T16:13:33Z"
  generation: 2
  labels:
    olm.owner: tracing-operator.v0.3.0
    olm.owner.kind: ClusterServiceVersion
    olm.owner.namespace: fleet-system
  name: tracing-operator
  namespace: fleet-system
  ownerReferences:
  - apiVersion: operators.coreos.com/v1alpha1
    blockOwnerDeletion: false
    controller: false
    kind: ClusterServiceVersion
    name: tracing-operator.v0.3.0
    uid: 96163eb2-fb31-49ee-992e-8a28c11e6e59
  resourceVersion: "14519115"
  selfLink: /apis/extensions/v1beta1/namespaces/fleet-system/deployments/tracing-operator
  uid: b5ebe819-147a-4504-ac94-548936852fac
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/instance: tracing-operator
      name: tracing-operator
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        alm-examples: '[]'
        capabilities: Basic Install
        olm.operatorGroup: fleet-operators
        olm.operatorNamespace: fleet-system
        olm.targetNamespaces: fleet-system
      creationTimestamp: null
      labels:
        app.kubernetes.io/instance: tracing-operator
        name: tracing-operator
    spec:
      containers:
      - env:
        - name: WATCH_NAMESPACE
           valueFrom:
             fieldRef:
               fieldPath: metadata.annotations['olm.targetNamespaces']
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: OPERATOR_NAME
          value: tracing-operator
        image: gcr.io/tg-rdv/fleet/tracing-operator:v0.3.0
        imagePullPolicy: IfNotPresent
        name: tracing-operator
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: tracing-operator
      serviceAccountName: tracing-operator
      terminationGracePeriodSeconds: 30
status:
  availableReplicas: 1
  conditions:
  - lastTransitionTime: "2020-02-18T16:13:35Z"
    lastUpdateTime: "2020-02-18T16:13:35Z"
    message: Deployment has minimum availability.
    reason: MinimumReplicasAvailable
    status: "True"
    type: Available
  - lastTransitionTime: "2020-02-18T16:13:33Z"
    lastUpdateTime: "2020-02-18T16:13:35Z"
    message: ReplicaSet "tracing-operator-6d5d584974" has successfully progressed.
    reason: NewReplicaSetAvailable
    status: "True"
    type: Progressing
  observedGeneration: 2
  readyReplicas: 1
  replicas: 1
  updatedReplicas: 1

Also the annotation named olm.targetNamespaces is not injected inside the deployment.

Am I missing something?

I am currently using:

  • operator-sdk: v0.15.0
  • operator lifecycle manager: quay.io/operator-framework/olm@sha256:0d15ffb5d10a176ef6e831d7865f98d51255ea5b0d16403618c94a004d049373
  • kubernetes: v1.15.5 (docker desktop)
@secat
Copy link
Author

secat commented Feb 19, 2020

I have tried to add a selector:

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: tracing-operator-subscription
  namespace: fleet-system
spec:
  channel: preview
  name: tracing-operator
  source: tracing-operator-catalog
  sourceNamespace: fleet-system
  config:
    selector:
      matchLabels:
        name: tracing-operator
    resources:
      limits:
        memory: 128Mi
      requests:
        cpu: 100m
        memory: 128Mi
    tolerations:
    - key: workload-isolation.infra.fleet
      operator: Equal
      value: default
      effect: NoSchedule

Here is the generated deployment:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  creationTimestamp: "2020-02-19T13:17:42Z"
  generation: 1
  labels:
    olm.owner: tracing-operator.v0.3.0
    olm.owner.kind: ClusterServiceVersion
    olm.owner.namespace: fleet-system
  name: tracing-operator
  namespace: fleet-system
  ownerReferences:
  - apiVersion: operators.coreos.com/v1alpha1
    blockOwnerDeletion: false
    controller: false
    kind: ClusterServiceVersion
    name: tracing-operator.v0.3.0
    uid: dd83fd50-d486-4a73-aec2-285aa6a5ebce
  resourceVersion: "14661603"
  selfLink: /apis/extensions/v1beta1/namespaces/fleet-system/deployments/tracing-operator
  uid: 884382ea-c3fd-410e-974b-a6867530ec9d
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      name: tracing-operator
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        alm-examples: '[]'
        capabilities: Basic Install
        olm.operatorGroup: fleet-operators
        olm.operatorNamespace: fleet-system
        olm.targetNamespaces: fleet-system
      creationTimestamp: null
      labels:
        name: tracing-operator
    spec:
      containers:
      - env:
        - name: OPERATOR_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.annotations['olm.targetNamespaces']
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: OPERATOR_NAME
          value: tracing-operator
        image: gcr.io/tg-rdv/fleet/tracing-operator:v0.3.0
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthz/liveness
            port: http-metrics
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        name: tracing-operator
        ports:
        - containerPort: 8383
          name: http-metrics
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthz/readiness
            port: http-metrics
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: tracing-operator
      serviceAccountName: tracing-operator
      terminationGracePeriodSeconds: 30

However, the resources and tolerations are not present in the deployment resource...

@secat
Copy link
Author

secat commented Feb 19, 2020

@tkashem I have ssen that you created this feature in PR #950, do you have any pointers to help me troubleshoot this?

@awgreene
Copy link
Member

awgreene commented Feb 20, 2020

Hello @secat,

Thank you for using OLM and starting this discussion. As you said, Tolerations and Restrictions are not acted on by OLM. AFAIK, only the resources listed within the OLM-Book are supported at this time.

I spoke with @tkashem offline, who had said that he based the SubscriptionConfig object on the kubernetes PodSpec definition, just to keep room for future growth as captured in the operator-config proposal.

@awgreene awgreene added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Feb 20, 2020
@awgreene
Copy link
Member

I marked this as a good first issue given that it should align closely with existing code.

@dinhxuanvu
Copy link
Member

@umangachapagain You are welcome to work on this issue as you requested.

@suratsuriya
Copy link

#1298 (comment)

2 similar comments
@suratsuriya
Copy link

#1298 (comment)

@suratsuriya
Copy link

#1298 (comment)

@Juggcode
Copy link

hey guys can anyone help me with my issue ?

@umangachapagain
Copy link
Contributor

Fixed by #1334

@stale
Copy link

stale bot commented May 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 15, 2020
@openshift-ci-robot openshift-ci-robot added triage/unresolved Indicates an issue that can not or will not be resolved. and removed wontfix labels May 16, 2020
@stale
Copy link

stale bot commented Jul 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Sep 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Nov 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Jan 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@timflannagan
Copy link
Contributor

Should we close this out? It looks like #1334 implementation this functionality a while back but automation didn't pick up that PR.

@dinhxuanvu
Copy link
Member

This issue is stale. Closed. Please feel free to reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. triage/unresolved Indicates an issue that can not or will not be resolved.
Projects
None yet
Development

No branches or pull requests

8 participants