diff --git a/Dockerfile b/Dockerfile index 411e280..d45236a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,13 @@ -# start based on a centos image -FROM rhel7 +# start based on a rhel image using a specific minor version. +FROM rhel7.4 ENV HOME=/opt/app-root/src \ - PATH=/opt/app-root/src/bin:/opt/app-root/bin:$PATH \ - RUBY_VERSION=2.0 \ + PATH=/opt/rh/rh-ruby22/root/usr/bin:/opt/app-root/src/bin:/opt/app-root/bin${PATH:+:${PATH}} \ + LD_LIBRARY_PATH=/opt/rh/rh-ruby22/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} \ + MANPATH=/opt/rh/rh-ruby22/root/usr/share/man:$MANPATH \ + PKG_CONFIG_PATH=/opt/rh/rh-ruby22/root/usr/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}} \ + XDG_DATA_DIRS=/opt/rh/rh-ruby22/root/usr/share${XDG_DATA_DIRS:+:${XDG_DATA_DIRS}} \ + RUBY_VERSION=2.2 \ FLUENTD_VERSION=0.12.32 \ GEM_HOME=/opt/app-root/src \ DATA_VERSION=1.6.0 \ @@ -31,8 +35,9 @@ LABEL io.k8s.description="Fluentd container for collecting logs from other fluen # bc for calculations in run.conf RUN yum install -y --disablerepo=\* --enablerepo=rhel-7-server-rpms --enablerepo=rhel-server-rhscl-7-rpms --enablerepo=rhel-7-server-optional-rpms --setopt=tsflags=nodocs \ gcc-c++ \ - ruby \ - ruby-devel \ + rh-ruby22 \ + rh-ruby22-rubygems \ + rh-ruby22-ruby-devel \ libcurl-devel \ make \ bc \ diff --git a/fluentd-forwarder-template.yaml b/fluentd-forwarder-template.yaml index 8b97824..369495a 100644 --- a/fluentd-forwarder-template.yaml +++ b/fluentd-forwarder-template.yaml @@ -145,6 +145,20 @@ objects: port ${TARGET_PORT} ${ADDITIONAL_OPTS} +- apiVersion: extensions/v1beta1 + kind: HorizontalPodAutoscaler + metadata: + name: fluentd-forwarder + spec: + scaleRef: + kind: DeploymentConfig + name: fluentd-forwarder + apiVersion: v1 + subresource: scale + minReplicas: 1 + maxReplicas: ${P_AUTOSCALE_MAX_PODS} + CPUUtilization: + targetPercentage: ${P_AUTOSCALE_TARGET_CPU} parameters: - name: P_NAMESPACE description: Target namespace for image. Used to reference the ImageStream source for the image. @@ -182,3 +196,9 @@ parameters: - name: P_KEY_PATH description: Path to the key that should be used for the server PKI. Defaults the the path outlined for secret mount. value: /secrets/tls.key + - name: P_AUTOSCALE_MAX_PODS + description: Maximum number of pods that fluentd-forwarder should scale up to. + value: "4" + - name: P_AUTOSCALE_TARGET_CPU + description: Target CPU Utilization for the HPA. + value: "80"