-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #554 from Mirantis/jell/examples_cleanup
Cleanup in examples + fedora example
- Loading branch information
Showing
10 changed files
with
232 additions
and
40 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
translations: | ||
- name: cirros | ||
url: https://github.com/mirantis/virtlet/releases/download/v0.8.2/cirros.img | ||
- name: fedora | ||
url: https://download.fedoraproject.org/pub/fedora/linux/releases/27/CloudImages/x86_64/images/Fedora-Cloud-Base-27-1.6.x86_64.qcow2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# This example is the same as a basic one but it's extended with | ||
# example values for VirtletCloudInitUserData and VirtletVCPUCount annotations | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: cirros-vm-with-additional-annotations | ||
annotations: | ||
# This tells CRI Proxy that this pod belongs to Virtlet runtime | ||
kubernetes.io/target-runtime: virtlet.cloud | ||
# An optional annotation specifying the count of virtual CPUs. | ||
# Note that annotation values must always be strings, | ||
# thus numeric values need to be quoted. | ||
# Defaults to "1". | ||
VirtletVCPUCount: "1" | ||
# CirrOS doesn't load nocloud data from SCSI CD-ROM for some reason | ||
VirtletDiskDriver: virtio | ||
# inject ssh keys via cloud-init | ||
VirtletSSHKeys: | | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost | ||
# cloud-init user data | ||
VirtletCloudInitUserDataScript: | | ||
#!/bin/sh | ||
echo "Hi there" | ||
spec: | ||
# This nodeAffinity specification tells Kubernetes to run this | ||
# pod only on the nodes that have extraRuntime=virtlet label. | ||
# This label is used by Virtlet DaemonSet to select nodes | ||
# that must have Virtlet runtime | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: extraRuntime | ||
operator: In | ||
values: | ||
- virtlet | ||
containers: | ||
- name: cirros-vm | ||
# This specifies the image to use. | ||
# virtlet.cloud/ prefix is used by CRI proxy, the remaining part | ||
# of the image name is prepended with https:// and used to download the image | ||
image: virtlet.cloud/cirros | ||
imagePullPolicy: IfNotPresent | ||
# tty and stdin required for `kubectl attach -t` to work | ||
tty: true | ||
stdin: true | ||
resources: | ||
limits: | ||
# This memory limit is applied to the libvirt domain definition | ||
memory: 160Mi |
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,47 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: fedora-vm-with-testuser | ||
annotations: | ||
kubernetes.io/target-runtime: virtlet.cloud | ||
VirtletCloudInitUserData: | | ||
ssh_pwauth: True | ||
users: | ||
- name: testuser | ||
gecos: User | ||
primary-group: testuser | ||
groups: users | ||
lock_passwd: false | ||
shell: /bin/bash | ||
# the password is "testuser" | ||
passwd: "$6$rounds=4096$wPs4Hz4tfs$a8ssMnlvH.3GX88yxXKF2cKMlVULsnydoOKgkuStTErTq2dzKZiIx9R/pPWWh5JLxzoZEx7lsSX5T2jW5WISi1" | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
ssh-authorized-keys: | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost | ||
VirtletSSHKeys: | | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: extraRuntime | ||
operator: In | ||
values: | ||
- virtlet | ||
# This is the number of seconds Virtlet gives the VM to shut down cleanly. | ||
# The default value of 30 seconds is ok for containers but probably too | ||
# low for VM, so overriding it here is strongly advised. | ||
terminationGracePeriodSeconds: 120 | ||
containers: | ||
- name: fedora-vm | ||
image: virtlet.cloud/fedora | ||
imagePullPolicy: IfNotPresent | ||
# tty and stdin required for `kubectl attach -t` to work | ||
tty: true | ||
stdin: true | ||
resources: | ||
limits: | ||
# This memory limit is applied to the libvirt domain definition | ||
memory: 256Mi |
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,33 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: fedora-vm | ||
annotations: | ||
kubernetes.io/target-runtime: virtlet.cloud | ||
VirtletSSHKeys: | | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: extraRuntime | ||
operator: In | ||
values: | ||
- virtlet | ||
# This is the number of seconds Virtlet gives the VM to shut down cleanly. | ||
# The default value of 30 seconds is ok for containers but probably too | ||
# low for VM, so overriding it here is strongly advised. | ||
terminationGracePeriodSeconds: 120 | ||
containers: | ||
- name: fedora-vm | ||
image: virtlet.cloud/fedora | ||
imagePullPolicy: IfNotPresent | ||
# tty and stdin required for `kubectl attach -t` to work | ||
tty: true | ||
stdin: true | ||
resources: | ||
limits: | ||
# This memory limit is applied to the libvirt domain definition | ||
memory: 256Mi |
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,45 @@ | ||
# This example shows how to add by cloud-init a user with sudo passwordless | ||
# access to root acount. User added that way will have as password "testuser". | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: ubuntu-vm-with-testuser | ||
annotations: | ||
kubernetes.io/target-runtime: virtlet.cloud | ||
VirtletCloudInitUserData: | | ||
ssh_pwauth: True | ||
users: | ||
- name: testuser | ||
gecos: User | ||
primary-group: testuser | ||
groups: users | ||
lock_passwd: false | ||
shell: /bin/bash | ||
# the password is "testuser" | ||
passwd: "$6$rounds=4096$wPs4Hz4tfs$a8ssMnlvH.3GX88yxXKF2cKMlVULsnydoOKgkuStTErTq2dzKZiIx9R/pPWWh5JLxzoZEx7lsSX5T2jW5WISi1" | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
ssh-authorized-keys: | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost | ||
VirtletSSHKeys: | | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: extraRuntime | ||
operator: In | ||
values: | ||
- virtlet | ||
# This is the number of seconds Virtlet gives the VM to shut down cleanly. | ||
# The default value of 30 seconds is ok for containers but probably too | ||
# low for VM, so overriding it here is strongly advised. | ||
terminationGracePeriodSeconds: 120 | ||
containers: | ||
- name: ubuntu-vm | ||
image: virtlet.cloud/cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img | ||
imagePullPolicy: IfNotPresent | ||
# tty and stdin required for `kubectl attach -t` to work | ||
tty: true | ||
stdin: true |
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,41 @@ | ||
# This example is ubuntu-vm.yaml one extended with example volume for docker | ||
# which makes it more usable as a test environment | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: ubuntu-vm-with-volume | ||
annotations: | ||
kubernetes.io/target-runtime: virtlet.cloud | ||
VirtletSSHKeys: | | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: extraRuntime | ||
operator: In | ||
values: | ||
- virtlet | ||
# This is the number of seconds Virtlet gives the VM to shut down cleanly. | ||
# The default value of 30 seconds is ok for containers but probably too | ||
# low for VM, so overriding it here is strongly advised. | ||
terminationGracePeriodSeconds: 120 | ||
containers: | ||
- name: ubuntu-vm | ||
image: virtlet.cloud/cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img | ||
imagePullPolicy: IfNotPresent | ||
# tty and stdin required for `kubectl attach -t` to work | ||
tty: true | ||
stdin: true | ||
volumeMounts: | ||
- name: docker | ||
mountPath: /var/lib/docker | ||
volumes: | ||
- name: docker | ||
flexVolume: | ||
driver: "virtlet/flexvolume_driver" | ||
options: | ||
type: qcow2 | ||
capacity: 2048MB |
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