mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #17075 from jeffvance/k8bps-fedora
Auto commit by PR queue bot
This commit is contained in:
commit
53c39d78ac
@ -14,14 +14,19 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ../../hack/lib/util.sh # need kube::util::host_platform()
|
||||||
|
|
||||||
|
HOST_OS=$(kube::util::host_platform)
|
||||||
|
HOST_OS=${HOST_OS%/*} # just host_os name
|
||||||
|
|
||||||
function setup_vm() {
|
function setup_vm() {
|
||||||
### Provider = vbox. You can use another one if you want... But untested.
|
### Provider = vbox. You can use another one if you want... But untested.
|
||||||
PROVIDER=virtualbox
|
PROVIDER=virtualbox
|
||||||
|
|
||||||
### Create a VM specific to this app...
|
### Create a VM specific to this app...
|
||||||
if docker-machine ls |grep -q k8petstore ; then
|
if docker-machine ls | grep -q k8petstore ; then
|
||||||
echo "VM already exists, moving on..."
|
echo "VM already exists, moving on..."
|
||||||
else
|
else
|
||||||
docker-machine create --driver $PROVIDER k8petstore
|
docker-machine create --driver $PROVIDER k8petstore
|
||||||
@ -34,27 +39,24 @@ function setup_docker() {
|
|||||||
eval "$(docker-machine env k8petstore)"
|
eval "$(docker-machine env k8petstore)"
|
||||||
docker rm -f `docker ps -a -q`
|
docker rm -f `docker ps -a -q`
|
||||||
|
|
||||||
### Now capture the IP.
|
|
||||||
MACHINE_IP="`docker-machine ip k8petstore`"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_containers() {
|
function build_containers() {
|
||||||
|
|
||||||
version="`date +"%m-%d-%Y-%s"`"
|
version="`date +"%m-%d-%Y-%s"`"
|
||||||
pushd ../redis
|
pushd redis
|
||||||
docker build -t jayunit100/k8-petstore-redis:$version ./
|
docker build -t jayunit100/k8-petstore-redis:$version ./
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd ../redis-master
|
pushd redis-master
|
||||||
docker build -t jayunit100/k8-petstore-redis-master:$version ./
|
docker build -t jayunit100/k8-petstore-redis-master:$version ./
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd ../redis-slave
|
pushd redis-slave
|
||||||
docker build -t jayunit100/k8-petstore-redis-slave:$version ./
|
docker build -t jayunit100/k8-petstore-redis-slave:$version ./
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd ../web-server
|
pushd web-server
|
||||||
docker build -t jayunit100/k8-petstore-web-server:$version ./
|
docker build -t jayunit100/k8-petstore-web-server:$version ./
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
@ -68,14 +70,16 @@ function runk8petstore() {
|
|||||||
### TODO, add slaves.
|
### TODO, add slaves.
|
||||||
|
|
||||||
echo "Running k8petstore now..."
|
echo "Running k8petstore now..."
|
||||||
docker run -d -p 6379:6379 jayunit100/k8-petstore-redis-master:$version
|
docker run --name redis -d -p 6379:6379 jayunit100/k8-petstore-redis-master:$version
|
||||||
docker run -d -e REDISMASTER_SERVICE_HOST=$MACHINE_IP -e REDISMASTER_SERVICE_PORT=6379 -p 3000:3000 jayunit100/k8-petstore-web-server:$version
|
docker run --link redis:redis -d -e REDISMASTER_SERVICE_HOST=redis -e REDISMASTER_SERVICE_PORT=6379 -p 3000:3000 jayunit100/k8-petstore-web-server:$version
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_vm
|
|
||||||
|
|
||||||
setup_docker
|
if [[ "$HOST_OS" != linux ]] ; then
|
||||||
|
setup_vm
|
||||||
|
setup_docker
|
||||||
|
fi
|
||||||
|
|
||||||
build_containers
|
build_containers
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#
|
#
|
||||||
# Just a stub.
|
# Just a stub.
|
||||||
|
|
||||||
FROM jayunit100/redis:2.8.19
|
FROM redis
|
||||||
|
|
||||||
ADD etc_redis_redis.conf /etc/redis/redis.conf
|
ADD etc_redis_redis.conf /etc/redis/redis.conf
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#
|
#
|
||||||
# Just a stub.
|
# Just a stub.
|
||||||
|
|
||||||
FROM jayunit100/redis:2.8.19
|
FROM redis
|
||||||
|
|
||||||
ADD run.sh /run.sh
|
ADD run.sh /run.sh
|
||||||
|
|
||||||
|
@ -5,30 +5,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Pull base image.
|
# Pull base image.
|
||||||
FROM ubuntu
|
FROM redis
|
||||||
|
|
||||||
# Install Redis.
|
|
||||||
RUN \
|
|
||||||
cd /tmp && \
|
|
||||||
# Modify to stay at this version rather then always update.
|
|
||||||
|
|
||||||
#################################################################
|
|
||||||
###################### REDIS INSTALL ############################
|
|
||||||
wget http://download.redis.io/releases/redis-2.8.19.tar.gz && \
|
|
||||||
tar xvzf redis-2.8.19.tar.gz && \
|
|
||||||
cd redis-2.8.19 && \
|
|
||||||
################################################################
|
|
||||||
################################################################
|
|
||||||
make && \
|
|
||||||
make install && \
|
|
||||||
cp -f src/redis-sentinel /usr/local/bin && \
|
|
||||||
mkdir -p /etc/redis && \
|
|
||||||
cp -f *.conf /etc/redis && \
|
|
||||||
rm -rf /tmp/redis-stable* && \
|
|
||||||
sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \
|
|
||||||
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \
|
|
||||||
sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf && \
|
|
||||||
sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf
|
|
||||||
|
|
||||||
# Define mountable directories.
|
# Define mountable directories.
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
|
Loading…
Reference in New Issue
Block a user