This repository has been archived by the owner on Nov 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(spec): add support for extraResources
With this root level field called `extraResources`, which is a list of file names of Kubernetes artifacts that can be fed to Kubernetes directly without kedge having to do any processing. Anything that is not supported in kedge can be provided using this field. Following is the example snippet of the app file that is using `extraResources` field to deploy a `secret.yaml` and a `cron-job.yaml` with the rest of kedge file. Here `secret.yaml` & `cron-jobs.yaml` reside in the same directory. e.g. ``` ... extraResources: - secret.yaml - cron-jobs.yaml ```
- Loading branch information
Showing
9 changed files
with
202 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# extraResources | ||
|
||
Kedge might not support all the things that Kubernetes has, but kedge would not | ||
come in your way to define anything that Kubernetes understands. | ||
|
||
For e.g. right now there is no way to define cron-jobs in kedge, but you can still | ||
specify the Kubernetes cron-job file. In this field called `extraResources`. | ||
|
||
See snippet from [app.yaml](app.yaml): | ||
|
||
```yaml | ||
extraResources: | ||
- cronjob.yaml | ||
``` | ||
So in this way you can specify list of files under root level field called | ||
`extraResources`. These files has configuration that Kubernetes understands, | ||
kedge won't do any processing on these files and feed them directly to | ||
Kubernetes. | ||
|
||
Also the file paths under `extraResources` should be relative to the kedge file | ||
in which this config is specified. | ||
|
||
This does not change anything with respect to deploying application. | ||
|
||
```console | ||
$ kedge create -f app.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: web | ||
containers: | ||
- image: centos/httpd | ||
volumeMounts: | ||
- name: web | ||
mountPath: /var/www/html/ | ||
services: | ||
- name: web | ||
type: NodePort | ||
ports: | ||
- port: 80 | ||
volumeClaims: | ||
- name: web | ||
size: 100Mi | ||
extraResources: | ||
- cronjob.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: batch/v2alpha1 | ||
kind: CronJob | ||
metadata: | ||
name: web | ||
spec: | ||
schedule: "*/1 * * * *" | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: web | ||
image: busybox | ||
args: | ||
- /bin/sh | ||
- -c | ||
- date > /var/www/html/index.html; echo 'Hello from the Kubernetes cluster' >> /var/www/html/index.html | ||
volumeMounts: | ||
- name: web | ||
mountPath: /var/www/html/ | ||
restartPolicy: OnFailure | ||
volumes: | ||
- name: web | ||
persistentVolumeClaim: | ||
claimName: web | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.