We need to provide some extra options when creating the kind cluster.
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: /kubernetes/volumes
Esto es una prueba de concepto de cómo funcionan los PersistentVolume en kubernetes. Creo un PersistentVolume y a partir de un PersistentVolumeClaim lo comparto entre dos contenedores. Un contenedor (aplicación java) escribe texto en el volumen. Mientras que el otro contenedor(un nginx) publica el contenido del volumen. He utilizado Kind.
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
import datetime | |
now = datetime.datetime.now().replace(second=0, microsecond=0) | |
# I use replace method to round to second and microsecond, as datetime is inmutable | |
minutesInAWeek = 7 * 24 * 60 # 7 days in a week, 24 hours a day, 60 minutes an hour | |
for i in reversed(range(minutesInAWeek)): | |
minuteInThePast = now - datetime.timedelta(minutes = i) |
import matplotlib.pyplot as plt | |
import numpy as np | |
numberOfDays = 7 | |
minutesPerDay = 24 * 60 | |
def addNoise(array, noise=5): | |
# some random noise | |
return array + np.random.rand( len(array) ) * noise |
# DISCLAIMER, this is not the best way to build a Docker Image. It is still WIP, so I find this way easier to modify. | |
FROM ubuntu:20.04 | |
ARG JAVA_VERSION=adoptopenjdk-8-hotspot | |
ARG MAVEN_VERSION=3.6.3 | |
# general stuff | |
RUN apt-get update | |
RUN apt-get install wget -y | |
RUN apt-get install apt-transport-https -y |
This is a PoC of running a self hosted Apache Maven Repository, Reposilite, and use it as a distribution management.
Just running the usual mvn clean deploy
, but deploy the jar into Reposilite.
All Apache Maven commands will run inside the Apache Maven Docker image
Building Maven containers needs to 'see' Reposilite ones. So we are going to create a network so as to all containers can see each other.
ARG GCC_VERSION=11 | |
FROM gcc:${GCC_VERSION} AS builder | |
ARG REDIS_VERSION=stable | |
# from https://redis.io/topics/quickstart | |
RUN wget https://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz && \ | |
tar xvzf redis-${REDIS_VERSION}.tar.gz && \ | |
cd redis-${REDIS_VERSION} && \ |