Skip to content

Instantly share code, notes, and snippets.

View rkamradt's full-sized avatar

Randy Kamradt rkamradt

View GitHub Profile
@rkamradt
rkamradt / installVM.sh
Last active May 19, 2020 22:10
Installing a VM with a specific block device for a disk
virt-install --name node1 --ram=2048 --disk /dev/sdb1 --vcpus 1 --os-type linux --os-variant ubuntu20.04 --graphics none --location 'http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/' --extra-args "console=tty0 console=ttyS0,115200n8"
@rkamradt
rkamradt / installVM.sh
Created May 7, 2020 01:55
Create VM for ubuntu 20.04
virt-install --name vm1 --ram=8192 --disk size=10 --vcpus 1 --os-type linux --os-variant ubuntu20.04 --graphics none --location 'http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/' --extra-args "console=tty0 console=ttyS0,115200n8"
# When prompted, use the vm name for the host name, and be sure to add openssh when asked for software to pre-install
# otherwise take defaults or most reasonable options. Follow install instructions till reboot, then ^]
virsh domifaddr vm1 # get ip address
ssh-copy-id [email protected] # use ip address from previous step
@rkamradt
rkamradt / vhost-ingress.yaml
Created May 3, 2020 18:29
Create an ingress for the readnews service
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: readnews-ingress
annotations:
cert-manager.io/issuer: ca-issuer
spec:
rules:
- host: readnews.local
http:
@rkamradt
rkamradt / issuer.yaml
Created May 3, 2020 18:26
create an issuer
apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
name: ca-issuer
spec:
ca:
secretName: ca-key-pair
@rkamradt
rkamradt / readnews.yaml
Last active May 3, 2020 17:42
Deployment for the readnews service
apiVersion: apps/v1
kind: Deployment
metadata:
name: readnews-deployment
labels:
app: readnews
spec:
selector:
matchLabels:
app: readnews
@rkamradt
rkamradt / newsreader-cronjob.yaml
Created May 3, 2020 16:32
A CronJob for the newsreader microservice
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name:
newsreader-cronjob
labels:
app: newsreader
spec:
schedule: "0 * * * *"
jobTemplate:
@rkamradt
rkamradt / newsreader-pod.yaml
Last active May 3, 2020 16:07
A bare-pod deployment of the newsreader microservice
apiVersion: v1
kind: Pod
metadata:
name:
newsreader-pod
labels:
app: newsreader
spec:
containers:
- name: newsreader
@rkamradt
rkamradt / pvc.yaml
Last active May 3, 2020 13:44
Persistent Volume Claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gluster-claim
spec:
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
@rkamradt
rkamradt / pv.yaml
Last active May 3, 2020 13:48
Persistent Volume
apiVersion: v1
kind: PersistentVolume
metadata:
name: gluster-pv
labels:
pv: gluster-pv
spec:
capacity:
storage: 130Gi
accessModes:
@rkamradt
rkamradt / endpoints.yaml
Created May 3, 2020 13:27
Endpoints to use the glusterfs-cluster
apiVersion: v1
kind: Endpoints
metadata:
name: glusterfs-cluster
subsets:
- addresses:
- ip: 192.168.0.104
ports:
- port: 1
---