Skip to content

Commit a67e3b7

Browse files
committed
updates
1 parent 221a8f3 commit a67e3b7

File tree

5 files changed

+297
-4
lines changed

5 files changed

+297
-4
lines changed

K8/AWS/setupvm.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ AWSKEY=yourkey
4747
AWSSECRET=yoursecret
4848
ZONE=us-east-1d
4949
REGION=us-east-1
50-
HOSTED_ZONE=screeley.sysdeseng.com
50+
HOSTED_ZONE=k8s.local
5151

5252
#Kops values if using rather than local-up-cluster.sh
5353
# i.e. KOPS_CLUSTERNAME=screeley-aws2 ; BUCKET_NAME=screeley-state-store
5454
KOPS_CLUSTERNAME=""
5555
BUCKET_NAME=""
5656
S3_KOPS=s3://
57-
KOPS_RELEASE=1.15.2
57+
KOPS_RELEASE=v1.15.2
5858
#KOPS_RELEASE=1.13.0
5959

6060
# Workspace Env Vars

lib/docker-base.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ then
1111
then
1212
$SUDO yum update >/dev/null 2>&1
1313
$SUDO yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1
14-
$SUDO yum install docker-ce docker-ce-cli containerd.io -y >/dev/null 2>&1
14+
$SUDO yum install docker-ce -y >/dev/null 2>&1
1515
# $SUDO yum check-update
1616
# $SUDO curl -fsSL https://get.docker.com/ | sh >/dev/null 2>&1
1717
else
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#! /bin/bash
2+
# Some automation to setting up OSE/K8 VM's
3+
# For RHEL Environments
4+
5+
SCRIPT_HOME="$(realpath $(dirname $0))"
6+
CONFIG_HOME=""
7+
8+
if [ -f "$SCRIPT_HOME/setupvm.config" ]
9+
then
10+
CONFIG_HOME=$SCRIPT_HOME
11+
elif [ -f "$K8_SCRIPT_HOME/setupvm.config" ]
12+
then
13+
CONFIG_HOME=$K8_SCRIPT_HOME
14+
else
15+
CONFIG_HOME="/root/setupvm-dev/Origin"
16+
fi
17+
18+
source $CONFIG_HOME/setupvm.config
19+
SUDO=""
20+
21+
DoBlock()
22+
{
23+
$SUDO lsblk
24+
echo "Based on output above, what block device should the registry be set up on?"
25+
read block_device
26+
if [ "$block_device" == "" ]
27+
then
28+
echo "no block device entered, default $DEFAULT_BLOCK will be used"
29+
$SUDO sh -c "echo 'DEVS=$DEFAULT_BLOCK' >> /etc/sysconfig/docker-storage-setup"
30+
$SUDO sh -c "echo 'VG=$VG' >> /etc/sysconfig/docker-storage-setup"
31+
else
32+
echo "block device /dev/$block_device will be used, is this acceptable? (y/n)"
33+
read isaccepted
34+
if [ "$isaccepted" == "$yval1" ] || [ "$isaccepted" == "$yval2" ]
35+
then
36+
$SUDO sh -c "echo 'DEVS=/dev/$block_device' >> /etc/sysconfig/docker-storage-setup"
37+
$SUDO sh -c "echo 'VG=$VG' >> /etc/sysconfig/docker-storage-setup"
38+
echo "docker-storage-setup file updated"
39+
else
40+
echo "Let's try again..."
41+
echo ""
42+
DoBlock
43+
fi
44+
fi
45+
}
46+
47+
#Perform Basic Host Configuration
48+
echo "................................."
49+
echo " Configuring Host Env"
50+
echo "................................."
51+
source $CONFIG_HOME/../../lib/host-config.sh
52+
53+
54+
# Install core software (go, etcd, docker, etc...)
55+
echo ""
56+
echo "................................."
57+
echo " Installing Host PreReqs"
58+
echo "................................."
59+
echo " ... ... Installing Base Software"
60+
source $CONFIG_HOME/../../lib/yum-rhel-4.sh
61+
echo " ... ... Installing Go-$GOVERSION"
62+
source $CONFIG_HOME/../../lib/install-go.sh
63+
#echo " ... ... Installing etcd-$ETCD_VER"
64+
#source $CONFIG_HOME/../../lib/install-etcd.sh
65+
echo " ... ... Installing Docker-$DOCKERVER"
66+
source $CONFIG_HOME/../../lib/docker-base.sh
67+
68+
echo ""
69+
echo "................................."
70+
echo " Configuring Docker"
71+
echo "................................."
72+
#if [ "$APP_TYPE" == "origin" ] && [ "$HOSTENV" == "rhel" ]
73+
#then
74+
# source $CONFIG_HOME/../../lib/docker-registry.sh
75+
#fi
76+
source $CONFIG_HOME/../../lib/docker-restart.sh
77+
78+
79+
# Clone Repos
80+
echo "................................."
81+
echo " Cloning Repos"
82+
echo "................................."
83+
source $CONFIG_HOME/../../lib/clone-repos.sh
84+
echo ""
85+
86+
# Create Profiles
87+
echo "................................."
88+
echo " Setting Bash Environment"
89+
echo "................................."
90+
source $CONFIG_HOME/../../lib/bash-profile-4.sh
91+
echo ""
92+
93+
# Cloud Config
94+
if [ "$ISCLOUD" == "aws" ] || [ "$ISCLOUD" == "gce" ]
95+
then
96+
echo "................................."
97+
echo " Performing Cloud Configurations"
98+
echo "................................."
99+
source $CONFIG_HOME/../../lib/cloud-config.sh
100+
echo ""
101+
fi
102+
103+
104+
# Post Install
105+
echo "................................."
106+
echo " Performing Post Configurations"
107+
echo "................................."
108+
source $CONFIG_HOME/../../lib/post-install.sh
109+
echo ""
110+
111+
# This is a common issue I've run into
112+
# export PATH=$PATH:$GOPATH/bin; go get -u github.com/cloudflare/cfssl/cmd/...
113+
114+
115+
echo ""
116+
echo " *********************************************** "
117+
echo ""
118+
echo " Script Complete! Origin RHEL Setup Completed on host $HOSTNAME!"
119+
echo ""
120+
echo " *********************************************** "
121+
122+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#! /bin/bash
2+
# Some automation to setting up 4.0 installer setup
3+
# of OCP running on RHEL
4+
5+
# keep most defaults as they are historically needed to run this script properly
6+
# Update the following:
7+
# RHNUSER (is using rhel and rhsm)
8+
# RHNPASS (ditto)
9+
#
10+
# CLUSTER_NAME
11+
# EMAIL
12+
# INSTALLER_VERSION (check releases for latest version)
13+
#
14+
# AWSKEY
15+
# AWSSECRET
16+
# ZONE
17+
# HOSTED_ZONE
18+
19+
20+
# Control Parameters
21+
RERUN=N
22+
23+
# RHSM Parameters
24+
SKIPSUBSCRIBE=N
25+
SKIPREPOS=N
26+
CUSTOM_OCP_REPO=N
27+
28+
# Base Parameters
29+
HOSTENV=centos
30+
APP_TYPE=origin
31+
SETUP_TYPE=installer
32+
IS_FOR_AMI=N
33+
GOVERSION="1.11.4"
34+
DOCKERVER="ce" # ce or podman are valid values - use ce for gardener client
35+
36+
# ---------------------------------
37+
# Openshift 4.0 Installer
38+
# ---------------------------------
39+
# -- Normal latest stable release versions
40+
OCPVERSION="4.0"
41+
INSTALLER_VERSION="latest"
42+
INSTALLER_TAR="openshift-install-linux-4.3.1.tar.gz"
43+
CLIENT_TAR="openshift-client-linux-4.3.1.tar.gz"
44+
# -- Nightly Latest Builds
45+
#INSTALLER_VERSION="nightly"
46+
#INSTALLER_VERSION="4.2.0-0.nightly-2019-08-27-152130"
47+
#INSTALLER_TAR="openshift-install-linux-4.2.0-0.nightly-2019-08-27-152130.tar.gz"
48+
# -- Custom Releases
49+
#INSTALLER_VERSION="custom"
50+
#INSTALLER_VERSION="4.1.0-rc.9"
51+
#INSTALLER_TAR="openshift-install-linux-4.1.0-rc.9.tar.gz"
52+
53+
# Num of Nodes and Masters
54+
MASTER_COUNT=1
55+
WORKER_COUNT=3
56+
# Disk and Machine Types
57+
ROOTSIZE=500
58+
ROOTIOPS=4000
59+
ROOTTYPE=io1
60+
MACHINETYPE=c5.9xlarge
61+
# Other Vars
62+
CLUSTER_NAME=screeley-c1
63+
64+
INSTALL_PASSWORD=changeme
65+
SSHPATH=/home/ec2-user/.ssh/id_rsa.pub
66+
PULLSECRETPATH=/root/pullsecret.json
67+
#-------------------------------------
68+
69+
#-------------------------------------
70+
# Gardener Variables
71+
#-------------------------------------
72+
GARDENER=no
73+
74+
# ------------------------------------
75+
# KUBEFED post-install.sh Vars
76+
# ------------------------------------
77+
KUBECTL_VERSION="latest"
78+
KUBEFEDCTL_VERSION="v0.1.0-rc5"
79+
KUBEFEDCTL_NAME="kubefedctl-0.1.0-rc5-linux-amd64.tgz"
80+
# ------------------------------------
81+
82+
# ------------------------------------
83+
#Cloud Provider Env Vars
84+
# ------------------------------------
85+
ISCLOUD=aws
86+
AWSKEY=local
87+
AWSSECRET=local
88+
ZONE=us-east-1
89+
# for AWS sysdeseng
90+
HOSTED_ZONE=screeley.sysdeseng.com
91+
# for GCE
92+
#HOSTED_ZONE=garden-proj.com
93+
# ------------------------------------
94+
95+
# Workspace Env Vars
96+
ORIGINWORKDIR="/etc/openshift-dev"
97+
KUBEWORKDIR="/etc/kubernetes-dev"
98+
INSTALLDIR="/root"
99+
SOURCEDIR="/opt"
100+
FEATURE_GATES="BlockVolume=true,PersistentLocalVolumes=true,LocalStorageCapacityIsolation=true,MountPropagation=true"
101+
DEFAULT_STORAGECLASS=false
102+
ENABLE_HOSTPATH=true
103+
FAST_CLONE=N
104+
105+
# cinder env vars
106+
CINDER_CLIENT=N
107+
108+
109+

yaml/hostpath/hostpath-pod-pvc.yaml

+63-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,72 @@ spec:
88
image: busybox
99
command: ["sleep", "600000"]
1010
volumeMounts:
11-
- name: hostpath-pvc
11+
- name: hostpath
1212
mountPath: "/usr/share/busybox/data"
1313
restartPolicy: "Never"
1414
volumes:
1515
- name: hostpath-pvc
1616
persistentVolumeClaim:
1717
claimName: hostpath
18+
19+
20+
kind: Pod
21+
apiVersion: v1
22+
metadata:
23+
name: test-pod
24+
spec:
25+
containers:
26+
- name: test-pod
27+
image: busybox
28+
command: ["sleep", "600000"]
29+
securityContext:
30+
privileged: true
31+
volumeMounts:
32+
- name: hostpath
33+
mountPath: "/usr/share/busybox/data"
34+
restartPolicy: "Never"
35+
volumes:
36+
volumes:
37+
- name: host-root-volume
38+
hostPath:
39+
path: /
40+
41+
42+
apiVersion: apps/v1
43+
kind: DaemonSet
44+
metadata:
45+
name: privileged
46+
spec:
47+
selector:
48+
matchLabels:
49+
name: privileged-container
50+
template:
51+
metadata:
52+
labels:
53+
name: privileged-container
54+
spec:
55+
containers:
56+
- name: busybox
57+
image: busybox
58+
resources:
59+
limits:
60+
cpu: 200m
61+
memory: 100Mi
62+
requests:
63+
cpu: 100m
64+
memory: 50Mi
65+
stdin: true
66+
securityContext:
67+
privileged: true
68+
volumeMounts:
69+
- name: host-root-volume
70+
mountPath: /host
71+
readOnly: true
72+
volumes:
73+
- name: host-root-volume
74+
hostPath:
75+
path: /
76+
hostNetwork: true
77+
hostPID: true
78+
restartPolicy: Always
79+

0 commit comments

Comments
 (0)