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

Add instructions on setting Akri Instance OwnerReference when requesting Akri Resources #35

Open
kate-goldenring opened this issue May 10, 2022 · 2 comments
Labels
good first issue Good for newcomers

Comments

@kate-goldenring
Copy link
Collaborator

Instead of using the Akri Controller, Akri users can deploy their own Kubernetes Objects (Pods, Deployments, DaemonSets, etc) to use the Kubernetes resources created by Akri. This is explained in the Requesting Akri Resources documentation. However, if a device goes offline and an Instance is deleted, the workload will remain. A way to avoid this is to add OwnerReferences like the Akri Controller does by default. This ensures that the Pod/Deployment/Job only runs so long as the device exists:

apiVersion: v1
kind: Pod
metadata:
  name: akri-broker
  ownerReferences:
  - apiVersion: akri.sh/v0
    blockOwnerDeletion: true
    controller: true
    kind: Instance
    name: akri-udev-video-985ff9
    uid: be3363ce-c84a-4c2e-8b68-d5186d48fb7b
spec:
  containers:
  - name: akri-broker
    image: nginx:latest
    resources:
      limits:
        akri.sh/akri-udev-video-985ff9: "1"
      requests:
        akri.sh/akri-udev-video-985ff9: "1"

The uid can be obtained by running kubectl get akrii --output=json | jq ".items[].metadata.uid"
We should provide a script -- maybe a series of jqueries -- for generating the OwnerReference that can be added to a PodSpec.

@kate-goldenring
Copy link
Collaborator Author

We need to confirm that this does not interfere with the Controller's owner references.

@kate-goldenring kate-goldenring added the good first issue Good for newcomers label Dec 5, 2023
@kate-goldenring
Copy link
Collaborator Author

@diconico07 checked. This does not interfere with the Controller's owner refs. This issue is available for anyone to pick up who wants to contribute to docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Backlog
Development

No branches or pull requests

1 participant