-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloud-init-with-nginx-secret.yaml
29 lines (29 loc) · 1.09 KB
/
cloud-init-with-nginx-secret.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
apiVersion: v1
kind: Secret
metadata:
name: cloudinit-with-nginx-secret
stringData:
userdata: |-
#cloud-config
ssh_pwauth: true
write_files:
- path: /root/install-nginx.sh
content: |
#! /bin/bash
## Install nginx on a KubeVirt VM
apt-get update && apt-get install nginx -y
## set a custome nginx welcome page
echo "Hello KubeVirts!!, I am being served from $(hostname)" | tee /var/www/html/index.nginx-debian.html
## start nginx service
service nginx start
permissions: '0755'
owner: root:root
users:
- name: ubuntu
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAA...QcKGwNfaFsfXqiw== kubevirt
sudo: ALL=(ALL) NOPASSWD:ALL
lock_passwd: false
shell: /bin/bash
runcmd:
- /root/install-nginx.sh