You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kube-applier is a service that enables continuous deployment of Kubernetes objects by applying declarative configuration files from a Git repository to a Kubernetes cluster.
5
+
kube-applier is a service that enables continuous deployment of Kubernetes objects by applying declarative configuration files from a Git repository to a Kubernetes cluster.
6
6
7
7
kube-applier runs as a Pod in your cluster and watches the [Git repo](#mounting-the-git-repository) to ensure that the cluster objects are up-to-date with their associated spec files (JSON or YAML) in the repo.
8
8
@@ -39,12 +39,38 @@ We suggest running kube-applier as a Deployment (see [demo/](https://github.com/
39
39
### Environment Variables
40
40
41
41
**Required:**
42
-
*`REPO_PATH` - (string) Absolute path to the directory containing configuration files to be applied. It must be a Git repository or a path within one. All .json and .yaml files within this directory (and its subdirectories) will be applied, unless listed on the blacklist.
42
+
*`REPO_PATH` - (string) Absolute path to the directory containing
43
+
* configuration files to be applied. It must be a Git repository or a path
44
+
* within one. All .json and .yaml files within this directory (and its
45
+
* subdirectories) will be applied, unless listed on the blacklist or excluded
46
+
* from the whitelist.
43
47
*`LISTEN_PORT` - (int) Port for the container. This should be the same port specified in the container spec.
44
48
45
49
**Optional:**
46
50
*`SERVER` - (string) Address of the Kubernetes API server. By default, discovery of the API server is handled by kube-proxy. If kube-proxy is not set up, the API server address must be specified with this environment variable (which is then written into a [kubeconfig file](http://kubernetes.io/docs/user-guide/kubeconfig-file/) on the backend). Authentication to the API server is handled by service account tokens. See [Accessing the Cluster](http://kubernetes.io/docs/user-guide/accessing-the-cluster/#accessing-the-api-from-a-pod) for more info.
47
-
*`BLACKLIST_PATH` - (string) Path to a "blacklist" file which specifies files that should not be applied. This path should be absolute (e.g. `/k8s/conf/kube_applier_blacklist`), not relative to `REPO_PATH` (although you may want to check the blacklist file into the repo). The blacklist file itself should be a plaintext file, with a file path on each line. Each of these paths should be relative to `REPO_PATH` (for example, if `REPO_PATH` is set to `/git/repo`, and the file to be blacklisted is `/git/repo/apps/app1.json`, the line in the blacklist file should be `apps/app1.json`).
51
+
*`BLACKLIST_PATH` - (string) Path to a "blacklist" file which specifies files
52
+
that should not be applied. This path should be absolute (e.g.
53
+
`/k8s/conf/kube_applier_blacklist`), not relative to `REPO_PATH` (although
54
+
you may want to check the blacklist file into the repo). The blacklist file
55
+
itself should be a plaintext file, with a file path on each line. Each of
56
+
these paths should be relative to `REPO_PATH` (for example, if `REPO_PATH` is
57
+
set to `/git/repo`, and the file to be blacklisted is
58
+
`/git/repo/apps/app1.json`, the line in the blacklist file should be
59
+
`apps/app1.json`).
60
+
*`WHITELIST_PATH` - (string) Path to a "whiltelist" file which is used to
61
+
make the applier consider a specific subset of files from the repo.
62
+
Only the files listed in the whitelist file will be considered for apply.
63
+
Empty whitelist (or unset env var) means all files in repo are eligible to be applied.
64
+
In case of a file is listed in both the whitelist and the blacklist, the file is
65
+
not applied.
66
+
This path should be absolute (e.g.
67
+
`/k8s/conf/kube_applier_whitelist`), not relative to `REPO_PATH` (although
68
+
you may want to check the whitelist file into the repo). The whitelist file
69
+
itself should be a plaintext file, with a file path on each line. Each of
70
+
these paths should be relative to `REPO_PATH` (for example, if `REPO_PATH` is
71
+
set to `/git/repo`, and the file to be whitelisted is
72
+
`/git/repo/apps/app1.json`, the line in the whiltelist file should be
73
+
`apps/app1.json`).
48
74
*`POLL_INTERVAL_SECONDS` - (int) Number of seconds to wait between each check for new commits to the repo (default is 5). Set to 0 to disable the wait period.
49
75
* <aname="run-interval"></a>`FULL_RUN_INTERVAL_SECONDS` - (int) Number of seconds between automatic full runs (default is 300, or 5 minutes). Set to 0 to disable the wait period.
50
76
*`DIFF_URL_FORMAT` - (string) If specified, allows the status page to display a link to the source code referencing the diff for a specific commit. `DIFF_URL_FORMAT` should be a URL for a hosted remote repo that supports linking to a commit hash. Replace the commit hash portion with "%s" so it can be filled in by kube-applier (e.g. `https://github.com/kubernetes/kubernetes/commit/%s`).
@@ -76,7 +102,7 @@ Mount a Git repository from a host directory. This can be useful when you want k
76
102
77
103
**What happens if the contents of the local Git repo change in the middle of a kube-applier run?**
78
104
79
-
If there are changes to files in the `$REPO_PATH` directory during a kube-applier run, those changes may or may not be reflected in that run, depending on the timing of the changes.
105
+
If there are changes to files in the `$REPO_PATH` directory during a kube-applier run, those changes may or may not be reflected in that run, depending on the timing of the changes.
80
106
81
107
Given that the `$REPO_PATH` directory is a Git repo or located within one, it is likely that the majority of changes will be associated with a Git commit. Thus, a change in the middle of a run will likely update the HEAD commit hash, which will immediately trigger another run upon completion of the current run (regardless of whether or not any of the changes were effective in the current run). However, changes that are not associated with a new Git commit will not trigger a run.
82
108
@@ -95,6 +121,7 @@ kube-applier hosts a status page on a webserver, served at the service endpoint
0 commit comments