forked from carvel-dev/kapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec78b70
commit 3c045a8
Showing
4 changed files
with
84 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Kapp on cluster | ||
|
||
This example shows how to run `kapp` continiously in cluster, and converge a set of apps available in a repositiory. | ||
|
||
To install perform: | ||
|
||
```bash | ||
$ ytt t -R -f examples/kapp-on-cluster/ | kapp --yes deploy -a kapp-on-cluster -f - --diff-changes | ||
``` | ||
|
||
See `cron.yml` for details on what this script does every 1m. |
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,37 @@ | ||
#@ load("@ytt:data", "data") | ||
|
||
apiVersion: batch/v1beta1 | ||
kind: CronJob | ||
metadata: | ||
name: kapp-on-cluster | ||
namespace: #@ data.values.namespace | ||
spec: | ||
schedule: "*/1 * * * *" | ||
suspend: #@ data.values.suspend | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
serviceAccount: kapp-on-cluster-sa | ||
restartPolicy: Never | ||
containers: | ||
- name: deploy | ||
image: ubuntu:xenial | ||
args: | ||
- /bin/bash | ||
- -c | ||
- | | ||
set -e -x | ||
apt-get update | ||
apt-get -y install wget git | ||
echo "Installing kapp..." | ||
wget -O- ??? > /tmp/kapp | ||
mv /tmp/kapp /usr/local/bin/kapp | ||
chmod +x /usr/local/bin/kapp | ||
echo "Installed kapp" | ||
git clone https://github.com/k14s/kapp | ||
cd kapp | ||
kapp --tty --yes app-group -g gitops deploy --directory examples/gitops |
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,5 @@ | ||
#@data/values | ||
--- | ||
#! namespace indicates where kapp will be installed | ||
namespace: default | ||
suspend: false |
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,31 @@ | ||
#@ load("@ytt:data", "data") | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: kapp-on-cluster-admin | ||
rules: | ||
- apiGroups: ['*'] | ||
resources: ['*'] | ||
verbs: ['*'] | ||
- nonResourceURLs: ['*'] | ||
verbs: ['*'] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kapp-on-cluster-admin-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kapp-on-cluster-admin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kapp-on-cluster-sa | ||
namespace: #@ data.values.namespace | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kapp-on-cluster-sa | ||
namespace: #@ data.values.namespace |