github.com/mirantis/virtlet@v1.5.2-0.20191204181327-1659b8a48e9b/examples/ubuntu-vm-with-testuser.yaml (about) 1 # This example shows how to add by cloud-init a user with sudo passwordless 2 # access to root acount. User added that way will have as password "testuser". 3 apiVersion: v1 4 kind: Pod 5 metadata: 6 name: ubuntu-vm-with-testuser 7 annotations: 8 kubernetes.io/target-runtime: virtlet.cloud 9 VirtletCloudInitUserData: | 10 ssh_pwauth: True 11 users: 12 - name: testuser 13 gecos: User 14 primary-group: testuser 15 groups: users 16 lock_passwd: false 17 shell: /bin/bash 18 # the password is "testuser" 19 passwd: "$6$rounds=4096$wPs4Hz4tfs$a8ssMnlvH.3GX88yxXKF2cKMlVULsnydoOKgkuStTErTq2dzKZiIx9R/pPWWh5JLxzoZEx7lsSX5T2jW5WISi1" 20 sudo: ALL=(ALL) NOPASSWD:ALL 21 ssh-authorized-keys: 22 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost 23 VirtletSSHKeys: | 24 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost 25 spec: 26 nodeSelector: 27 extraRuntime: virtlet 28 29 # This is the number of seconds Virtlet gives the VM to shut down cleanly. 30 # The default value of 30 seconds is ok for containers but probably too 31 # low for VM, so overriding it here is strongly advised. 32 terminationGracePeriodSeconds: 120 33 containers: 34 - name: ubuntu-vm 35 image: virtlet.cloud/cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img 36 imagePullPolicy: IfNotPresent 37 # tty and stdin required for `kubectl attach -t` to work 38 tty: true 39 stdin: true