diff --git a/.final_builds/jobs/k3s-agent-airgaped-images/index.yml b/.final_builds/jobs/k3s-agent-airgaped-images/index.yml new file mode 100644 index 00000000..85ec2ede --- /dev/null +++ b/.final_builds/jobs/k3s-agent-airgaped-images/index.yml @@ -0,0 +1,6 @@ +builds: + a40f672ab55c059a574505773ad52eba2289a2ba7bb429ee912c06df0069865c: + version: a40f672ab55c059a574505773ad52eba2289a2ba7bb429ee912c06df0069865c + blobstore_id: 80f7d259-09d4-48ad-518d-49cf0641e54e + sha1: sha256:47c06fd31e1652ed34f362e8735e1f6dec3f2fc1dc5310aa1506782b0214e6ca +format-version: "2" diff --git a/.final_builds/jobs/k3s-agent/index.yml b/.final_builds/jobs/k3s-agent/index.yml index 82cc9856..da12daa1 100644 --- a/.final_builds/jobs/k3s-agent/index.yml +++ b/.final_builds/jobs/k3s-agent/index.yml @@ -7,6 +7,10 @@ builds: version: 31331644ddf17d3128cc2c5be631f950c381d85f31b0da879bb3e7ec87c7425d blobstore_id: 6a9f3709-73d3-4141-5fd5-8039866d0591 sha1: sha256:f9765052a793d1f650ef88beb2362ff851ead6c0367d47b5c99b88907b7b82a9 + 4f6d8e6a215704d7b2031495b0bb461222c60e8f9b096b6c7844fd777c07fee7: + version: 4f6d8e6a215704d7b2031495b0bb461222c60e8f9b096b6c7844fd777c07fee7 + blobstore_id: 1af22e8b-2101-4eb2-7059-197dedba7f09 + sha1: sha256:9356dbda910cc1bb3902188638239832776703908c1c18c8b5e8602f1967bdff 56423cc75a6c653b3d5998e459a50bba4bc7d8303445b2286b6daeb6572c6be5: version: 56423cc75a6c653b3d5998e459a50bba4bc7d8303445b2286b6daeb6572c6be5 blobstore_id: f1d3412c-a43c-49fb-5a92-9da7b20d8294 diff --git a/.final_builds/jobs/k3s-server-airgaped-images/index.yml b/.final_builds/jobs/k3s-server-airgaped-images/index.yml new file mode 100644 index 00000000..99e665db --- /dev/null +++ b/.final_builds/jobs/k3s-server-airgaped-images/index.yml @@ -0,0 +1,6 @@ +builds: + c34c089469901cde75116adcb0d8de9c186ed301b4166ffc0f532da5cd2e7440: + version: c34c089469901cde75116adcb0d8de9c186ed301b4166ffc0f532da5cd2e7440 + blobstore_id: ceda4cd6-c78c-4318-4029-c729d1e97004 + sha1: sha256:94b3c2d59c7aab44723dd6aeceb5d9658c2d3c372212f20807ceabdc0f7a7953 +format-version: "2" diff --git a/.final_builds/jobs/k3s-server/index.yml b/.final_builds/jobs/k3s-server/index.yml index dca12c27..95254de1 100644 --- a/.final_builds/jobs/k3s-server/index.yml +++ b/.final_builds/jobs/k3s-server/index.yml @@ -35,6 +35,10 @@ builds: version: 85cbbe9198ed988a83185dbf9ddf52e6979f18b78a902198289df16b44e37a6f blobstore_id: 21b746aa-39a6-40f4-5021-622a56913fb7 sha1: sha256:3417e6aa91f950e880ec5b286ffded241c6bfef48a025a56ce69e8d65300986a + a01f52790a95df1f9f9bbeeadd03fa45777a00f0f75267dc835c44ab74431edb: + version: a01f52790a95df1f9f9bbeeadd03fa45777a00f0f75267dc835c44ab74431edb + blobstore_id: ea78ab75-bb8a-4035-43e9-1c27ee217909 + sha1: sha256:ce5325ab3dd4a6804f2565220640f53419bbaa9873196412010b57b7c72d70f5 a39c16432a77d74db4b196076656a69b6a5eee052e39105dadce4cda8909d81d: version: a39c16432a77d74db4b196076656a69b6a5eee052e39105dadce4cda8909d81d blobstore_id: 2668a214-d655-4bbc-6bfe-7711499fee14 diff --git a/.final_builds/packages/k3s/index.yml b/.final_builds/packages/k3s/index.yml index bb79ce47..b821c42f 100644 --- a/.final_builds/packages/k3s/index.yml +++ b/.final_builds/packages/k3s/index.yml @@ -7,6 +7,10 @@ builds: version: 79950a7a1c37a84c0cda3cd8ed316bb4e4dcdbeea8a079cdcf5e5009bbac58f9 blobstore_id: d379e0a2-1a6d-4046-5e00-6587f5634ca9 sha1: sha256:9abed7bfee5a719b098bd4b0d8ae5aba11775b5ab088bf4fb8328cb40c35f348 + 86d856c7d6464004304bdd286d2431966548c756f4cab0cd2860874637fa5c20: + version: 86d856c7d6464004304bdd286d2431966548c756f4cab0cd2860874637fa5c20 + blobstore_id: 22963ed2-efde-4a06-7bc5-7412dd6a1c5d + sha1: sha256:a112fe4708dc71c4bb341902a1c126a01f5c798a717fce21e707d159227efa2f 8ea88056382da1f76dce0ffa03251f81d0890147a1c3dd56ad4fb98868661b0c: version: 8ea88056382da1f76dce0ffa03251f81d0890147a1c3dd56ad4fb98868661b0c blobstore_id: 81b930ab-ebc2-476e-4d1e-ec38fd140f53 diff --git a/README.md b/README.md index 00b3a9f5..bc3e17d5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # BOSH release for k3s +

k3s Logo

+

bosh Logo

+ + + + This BOSH release and deployment manifest deploy a cluster of k3s Lightweight Kubernetes. 5 less than k8s. https://k3s.io. diff --git a/addblob.sh b/addblob.sh index f99f605d..1af60909 100755 --- a/addblob.sh +++ b/addblob.sh @@ -1,9 +1,9 @@ #!/bin/bash -wget https://github.com/k3s-io/k3s/releases/download/v1.19.5%2Bk3s2/k3s -O src/k3s +wget https://github.com/k3s-io/k3s/releases/download/v1.19.7%2Bk3s1/k3s -O src/k3s bosh add-blob src/k3s k3s/k3s -#wget https://github.com/k3s-io/k3s/releases/download/v1.19.4%2Bk3s1/k3s-airgap-images-amd64.tar -O src/k3s-airgap-images-amd64.tar -#bosh add-blob src/k3s-airgap-images-amd64.tar k3s-images/k3s-airgap-images-amd64.tar +wget https://github.com/k3s-io/k3s/releases/download/v1.19.7%2Bk3s1/k3s-airgap-images-amd64.tar -O src/k3s-airgap-images-amd64.tar +bosh add-blob src/k3s-airgap-images-amd64.tar k3s-images/k3s-airgap-images-amd64.tar wget https://github.com/derailed/k9s/releases/download/v0.24.2/k9s_Linux_x86_64.tar.gz -O src/k9s_Linux_x86_64.tar.gz cd src diff --git a/config/blobs.yml b/config/blobs.yml index 1fa2836d..f82b9822 100644 --- a/config/blobs.yml +++ b/config/blobs.yml @@ -1,14 +1,14 @@ k3s-images/k3s-airgap-images-amd64.tar: size: 369606656 - object_id: c9ff85f9-99b8-465e-50f9-1adde18eb1a9 - sha: sha256:01c8663f5f6c57b2bd4127c27c731a482ebb800a94742ccf6795211e154cf1cb + object_id: 525da1f4-69d3-49bd-413c-1d21ad832416 + sha: sha256:74bbc7ee9799c191f0c59b50c9fc290ba6399c7008d852a68ab2cf7892ead3e1 k3s/k3s: - size: 53510144 - object_id: 67ebeed1-e1e3-4319-4c79-a3f0ee4595ad - sha: sha256:314e06deb3219023fa8606d9bc238783d5bbc5c1036106d41c4ce95d154a0210 + size: 53530624 + object_id: 1607b17b-5392-4f2f-5254-5391dffdce9d + sha: sha256:075956b5c5c9fd21770f88fe4d912a52fe1b99ac7047358380c487505e3ebd13 k9s/k9s: size: 49266688 - object_id: f3653399-a212-45f6-4bf4-f565b6244d10 + object_id: dfe544d8-d866-4378-67ad-f977dd885bff sha: sha256:664be5c63ec5c01922ab8e95b43e948e0f17ac0ee845b34c0c1a03c957814bd9 kubectl/kubectl: size: 43003904 diff --git a/jobs/k3s-airgaped-images/monit b/jobs/k3s-agent-airgaped-images/monit similarity index 100% rename from jobs/k3s-airgaped-images/monit rename to jobs/k3s-agent-airgaped-images/monit diff --git a/jobs/k3s-airgaped-images/spec b/jobs/k3s-agent-airgaped-images/spec similarity index 90% rename from jobs/k3s-airgaped-images/spec rename to jobs/k3s-agent-airgaped-images/spec index b261be54..4df7a21e 100644 --- a/jobs/k3s-airgaped-images/spec +++ b/jobs/k3s-agent-airgaped-images/spec @@ -1,5 +1,5 @@ --- -name: k3s-airgaped-images +name: k3s-agent-airgaped-images packages: - k3s-images diff --git a/jobs/k3s-airgaped-images/templates/bin/pre-start.erb b/jobs/k3s-agent-airgaped-images/templates/bin/pre-start.erb similarity index 60% rename from jobs/k3s-airgaped-images/templates/bin/pre-start.erb rename to jobs/k3s-agent-airgaped-images/templates/bin/pre-start.erb index 7f861ea6..3bd1114a 100644 --- a/jobs/k3s-airgaped-images/templates/bin/pre-start.erb +++ b/jobs/k3s-agent-airgaped-images/templates/bin/pre-start.erb @@ -2,9 +2,8 @@ #copy images to containerd expected location (datadir/images) for airgap start. # see https://rancher.com/docs/k3s/latest/en/installation/airgap/ -mkdir -p /var/vcap/store/k3s-server/images -cd /var/vcap/store/k3s-server/images -tar xfv /var/vcap/packages/k3s-images/k3s-airgap-images-amd64.tar +mkdir -p /var/vcap/data/k3s-agent/kubelet/images +cp /var/vcap/packages/k3s-images/k3s-airgap-images-amd64.tar /var/vcap/data/k3s-agent/kubelet/images echo 'done installing airgaped docker images for containerd' exit 0 diff --git a/jobs/k3s-airgaped-images/templates/config/bpm.yml b/jobs/k3s-agent-airgaped-images/templates/config/bpm.yml similarity index 100% rename from jobs/k3s-airgaped-images/templates/config/bpm.yml rename to jobs/k3s-agent-airgaped-images/templates/config/bpm.yml diff --git a/jobs/k3s-agent/templates/bin/ctl.erb b/jobs/k3s-agent/templates/bin/ctl.erb index 68ec9939..62d9bd50 100755 --- a/jobs/k3s-agent/templates/bin/ctl.erb +++ b/jobs/k3s-agent/templates/bin/ctl.erb @@ -22,6 +22,10 @@ case $1 in <% end %> export FLAGS="" + + #adapt kubelet root dir to match bosh fs + export FLAGS="$FLAGS --kubelet-arg=root-dir=/var/vcap/data/k3s-agent/kubelet" + <% if_p('k3s.node-labels') do |value| %> <% p('k3s.node-labels').each do |label| %> diff --git a/jobs/k3s-server-airgaped-images/monit b/jobs/k3s-server-airgaped-images/monit new file mode 100644 index 00000000..e69de29b diff --git a/jobs/k3s-server-airgaped-images/spec b/jobs/k3s-server-airgaped-images/spec new file mode 100644 index 00000000..e29df1b8 --- /dev/null +++ b/jobs/k3s-server-airgaped-images/spec @@ -0,0 +1,18 @@ +--- +name: k3s-server-airgaped-images + +packages: +- k3s-images + +templates: + bin/pre-start.erb: bin/pre-start + +# Documentation https://bosh.io/docs/links.html +# Tutorial https://gist.github.com/Amit-PivotalLabs/c39528248b8cdc4ba8e347f8aa68abb6 +consumes: [] + +provides: +- name: k3s-airgaped-images + type: k3s-airgaped-images + +properties: {} diff --git a/jobs/k3s-server-airgaped-images/templates/bin/pre-start.erb b/jobs/k3s-server-airgaped-images/templates/bin/pre-start.erb new file mode 100644 index 00000000..b14f1cab --- /dev/null +++ b/jobs/k3s-server-airgaped-images/templates/bin/pre-start.erb @@ -0,0 +1,9 @@ +#!/bin/sh + +#copy images to containerd expected location (datadir/images) for airgap start. +# see https://rancher.com/docs/k3s/latest/en/installation/airgap/ +mkdir -p /var/vcap/data/k3s-server/kubelet/images +cp /var/vcap/packages/k3s-images/k3s-airgap-images-amd64.tar /var/vcap/data/k3s-server/kubelet/images + +echo 'done installing airgaped docker images for containerd' +exit 0 diff --git a/jobs/k3s-server-airgaped-images/templates/config/bpm.yml b/jobs/k3s-server-airgaped-images/templates/config/bpm.yml new file mode 100644 index 00000000..5b22f4f4 --- /dev/null +++ b/jobs/k3s-server-airgaped-images/templates/config/bpm.yml @@ -0,0 +1,16 @@ +--- +processes: +- name: k3s-airgaped-images + executable: /var/vcap/packages/k3s-airgaped-images/bin/k3s-airgaped-images + args: [] + ephemeral_disk: true + persistent_disk: false + env: + PORT: <%= p("port") %> + limits: + memory: 1G + open_files: 1024 + +# examples/docs at: +# - https://github.com/cloudfoundry-incubator/bpm-release/blob/master/jobs/test-server/templates/bpm.yml.erb +# - https://github.com/cloudfoundry-incubator/bpm-release/tree/master/docs diff --git a/jobs/k3s-server/templates/bin/ctl.erb b/jobs/k3s-server/templates/bin/ctl.erb index 28f7db3c..51efab35 100755 --- a/jobs/k3s-server/templates/bin/ctl.erb +++ b/jobs/k3s-server/templates/bin/ctl.erb @@ -35,6 +35,10 @@ case $1 in export FLAGS="" + + #adapt kubelet root dir to match bosh fs + export FLAGS="$FLAGS --kubelet-arg=root-dir=/var/vcap/data/k3s-server/kubelet" + <% if_p('k3s.disable') do |value| %> <% p('k3s.disable').each do |components| %> export FLAGS="$FLAGS --disable <%= components %>" diff --git a/jobs/k3s-server/templates/bin/envrc b/jobs/k3s-server/templates/bin/envrc index 2f2f8119..c4b4307b 100644 --- a/jobs/k3s-server/templates/bin/envrc +++ b/jobs/k3s-server/templates/bin/envrc @@ -5,3 +5,4 @@ export PATH=$PATH:/var/vcap/packages/k9s export PATH=$PATH:/var/vcap/packages/kubectl-k3s export KUBECONFIG=/var/vcap/store/k3s-server/kubeconfig.yml +alias crictl="k3s crictl" \ No newline at end of file diff --git a/releases/k3s/index.yml b/releases/k3s/index.yml index 0d4d7b6c..ab524468 100644 --- a/releases/k3s/index.yml +++ b/releases/k3s/index.yml @@ -5,6 +5,8 @@ builds: version: "12" 30048db2-3d9d-40cc-4dd7-5ca02ff12b66: version: "4" + 30fb0991-0e29-4d14-551d-fc03e90e9320: + version: "13" 4bd13971-4d5f-45ef-71cd-8b9f587f8fa1: version: "10" 4e64a643-4d01-48fa-794b-6564cef26f31: diff --git a/releases/k3s/k3s-13.yml b/releases/k3s/k3s-13.yml new file mode 100644 index 00000000..841c3be8 --- /dev/null +++ b/releases/k3s/k3s-13.yml @@ -0,0 +1,58 @@ +name: k3s +version: "13" +commit_hash: bf4ca12 +uncommitted_changes: false +jobs: +- name: k3s-agent + version: 4f6d8e6a215704d7b2031495b0bb461222c60e8f9b096b6c7844fd777c07fee7 + fingerprint: 4f6d8e6a215704d7b2031495b0bb461222c60e8f9b096b6c7844fd777c07fee7 + sha1: sha256:9356dbda910cc1bb3902188638239832776703908c1c18c8b5e8602f1967bdff + packages: + - k3s + - kubectl-k3s + - k3s-images +- name: k3s-agent-airgaped-images + version: a40f672ab55c059a574505773ad52eba2289a2ba7bb429ee912c06df0069865c + fingerprint: a40f672ab55c059a574505773ad52eba2289a2ba7bb429ee912c06df0069865c + sha1: sha256:47c06fd31e1652ed34f362e8735e1f6dec3f2fc1dc5310aa1506782b0214e6ca + packages: + - k3s-images +- name: k3s-server + version: a01f52790a95df1f9f9bbeeadd03fa45777a00f0f75267dc835c44ab74431edb + fingerprint: a01f52790a95df1f9f9bbeeadd03fa45777a00f0f75267dc835c44ab74431edb + sha1: sha256:ce5325ab3dd4a6804f2565220640f53419bbaa9873196412010b57b7c72d70f5 + packages: + - k3s + - k9s + - kubectl-k3s +- name: k3s-server-airgaped-images + version: c34c089469901cde75116adcb0d8de9c186ed301b4166ffc0f532da5cd2e7440 + fingerprint: c34c089469901cde75116adcb0d8de9c186ed301b4166ffc0f532da5cd2e7440 + sha1: sha256:94b3c2d59c7aab44723dd6aeceb5d9658c2d3c372212f20807ceabdc0f7a7953 + packages: + - k3s-images +packages: +- name: k3s + version: 86d856c7d6464004304bdd286d2431966548c756f4cab0cd2860874637fa5c20 + fingerprint: 86d856c7d6464004304bdd286d2431966548c756f4cab0cd2860874637fa5c20 + sha1: sha256:a112fe4708dc71c4bb341902a1c126a01f5c798a717fce21e707d159227efa2f + dependencies: [] +- name: k3s-images + version: c78a8c2e8cd3d8f69ec70c3f38db944e40cdd94f79ce9a32eef8325cf9c08311 + fingerprint: c78a8c2e8cd3d8f69ec70c3f38db944e40cdd94f79ce9a32eef8325cf9c08311 + sha1: sha256:359a920d70cd47fa7ce7176a2fa4bb647c17c03b8f5191f7a22ab9be65b56a9c + dependencies: [] +- name: k9s + version: 24b739026ef4bf491afc64ba3f32f7373dfe02e72f3f12a99af4f2c2b0eb106b + fingerprint: 24b739026ef4bf491afc64ba3f32f7373dfe02e72f3f12a99af4f2c2b0eb106b + sha1: sha256:c1cffd40cbbb48bd80a35acf981d428051740da0c68835de7bede43d24cb3ece + dependencies: [] +- name: kubectl-k3s + version: 41fe074fc5fe879b1909bdc82b3050c42b94e2d4aa945de2ce4e5f5737feb8dc + fingerprint: 41fe074fc5fe879b1909bdc82b3050c42b94e2d4aa945de2ce4e5f5737feb8dc + sha1: sha256:79ec01ab7c166b7121052ee44ce0109bb0318bb8e14e5e23c7b1d9dc5f619910 + dependencies: [] +license: + version: cf0ca1fe65dee9607c7bb9460a3f20835e582cbb7f5b2c3625fba2e21d7e91b9 + fingerprint: cf0ca1fe65dee9607c7bb9460a3f20835e582cbb7f5b2c3625fba2e21d7e91b9 + sha1: sha256:cbe3175489dfaec91e9f392399fbfb68e008885feb91a3b8d493a35d2fc5a8fa