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

Kubernetes Adapter #156

Merged
merged 32 commits into from
Sep 29, 2020
Merged

Kubernetes Adapter #156

merged 32 commits into from
Sep 29, 2020

Conversation

johrstrom
Copy link
Contributor

Right now here's how to configure this in a clusters.d/k8s.yml file.

v2:
  metadata:
    title: "Kubernetes"
    url: "https://<host:port>/"
    hidden: false
  login:
    host: "localhost"
  job:
    adapter: "kubernetes"
    config: "/home/$USER/.kube/kind-config-kind"
    bin: "/home/$USER/bin/kubectl"
    restart_policy: "OnFailure"
    volumes:
    - name: "home" 
      path: "/home"
      type: "hostPath"

It works exclusively off of native attributes. Here's an example BC application I've been working with. There is nothing in the template directory, it's empty.

You are only deploying a container that has a name and runs a command, and exposes a port.

[jeff@localhost bc_k8s]$ cat form.yml 
---
cluster: "k8s"

form:
- name
- image
- command
- port
[jeff@localhost bc_k8s]$ cat submit.yml.erb 
---
script:
  native:
    container:
      name: <%= name %>
      image: <%= image %>
      command: <%= command %>
      port: <%= port %>

@johrstrom
Copy link
Contributor Author

I'm going to close this because I'm going to be pushing to it and I don't really want to get the updates. It's still very much work in progress.

@johrstrom johrstrom closed this Dec 27, 2019
@johrstrom johrstrom reopened this Dec 31, 2019
We cannot use odic token with the --token flag. We'll have to
generate the configuration in the nginx stage due to timing issues
(the access_token is only valid for so long) and oidc realm issues
(the access_token given is for ood not the k8s cluster, it's a
different realm).
@ericfranz ericfranz marked this pull request as draft April 23, 2020 10:25
All other adapters use a batch class to do the actual work with their
schedulers, so this is a refactor to use that same pattern.
* allows for all_namespaces toggle for sites that can see other namespaces
* mounts use symbols in pod.yml.erb to align with everything else
* bugfix for nothing returned in get pods
@johrstrom
Copy link
Contributor Author

This can be reviewed at this point, maybe next week?

johrstrom added 2 commits June 8, 2020 16:58
- users can now define mounts within the job and at the cluster level
- cleaned up the pod.yml.erb just a little to get rid of useless
'unless' statements
@johrstrom johrstrom marked this pull request as ready for review June 9, 2020 14:57
@johrstrom johrstrom changed the title [WIP] Kubernetes Adapter Kubernetes Adapter Jun 9, 2020
@johrstrom
Copy link
Contributor Author

johrstrom commented Jun 9, 2020

I believe this is ready to be squashed and merged.

@johrstrom
Copy link
Contributor Author

OK, this now is ready to be squashed and merged. I just made one last update to support multiple environments like dev/test and production.

@johrstrom johrstrom merged commit 76b028c into master Sep 29, 2020
@johrstrom johrstrom deleted the k8s-adapter branch December 11, 2020 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant