-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3818 from cluibm/agent-install
update cluster support for s390x
- Loading branch information
Showing
4 changed files
with
83 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.1 | ||
|
||
LABEL vendor="IBM" | ||
LABEL summary="The agent auto upgrade cron job for edge clusters." | ||
LABEL description="" | ||
|
||
# add EPEL repo with jq pkg and all deps | ||
COPY EPEL.repo /etc/yum.repos.d | ||
|
||
# The build calls adduser (from shadow-utils) | ||
# The auto-upgrade-cronjob.sh calls jq (from jq) | ||
# Download kubectl | ||
# Create required directories | ||
# Create cronjobuser | ||
ARG REQUIRED_RPMS="shadow-utils jq" | ||
RUN microdnf update -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager \ | ||
&& microdnf install -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager ${REQUIRED_RPMS} \ | ||
&& microdnf clean all --disableplugin=subscription-manager \ | ||
&& rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* \ | ||
&& curl -4LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/s390x/kubectl \ | ||
&& chmod +x ./kubectl \ | ||
&& mv ./kubectl /usr/local/bin \ | ||
&& mkdir -p /tmp/agentbackup \ | ||
&& adduser cronjobuser -u 1000 -U -f -1 -c "cronjob user,1,2,3" | ||
|
||
# Copy cronjob script into container | ||
COPY cronjobs/auto-upgrade-cronjob.sh /usr/local/bin/ | ||
|
||
# Give user access to cronjob script | ||
RUN chown -R cronjobuser:cronjobuser /usr/local/bin/auto-upgrade-cronjob.sh /tmp/agentbackup | ||
|
||
USER cronjobuser | ||
RUN chmod 755 /usr/local/bin/auto-upgrade-cronjob.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.1 | ||
|
||
LABEL vendor="IBM" | ||
LABEL summary="The agent for edge clusters." | ||
LABEL description="The agent in a container that is used solely for the purpose of running the agent in a kubernetes edge cluster." | ||
|
||
# add EPEL repo with jq pkg and all deps | ||
COPY EPEL.repo /etc/yum.repos.d | ||
|
||
# The anax binary (secrets manager code) shells out to groupadd, groupdel (from shadow-utils), pkill (from procps-ng) | ||
# The anax.service calls jq (from jq) and killall (from psmisc) | ||
# anax does not use iptables directly but the github.com/coreos/go-iptables/iptables dependency needs the directory structure | ||
# Create required directories | ||
ARG REQUIRED_RPMS="openssl ca-certificates shadow-utils jq iptables vim-minimal psmisc procps-ng" | ||
RUN microdnf update -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager \ | ||
&& microdnf install -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager ${REQUIRED_RPMS} \ | ||
&& microdnf clean all --disableplugin=subscription-manager \ | ||
&& rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* \ | ||
&& mkdir -p /licenses /usr/horizon/bin /usr/horizon/web /var/horizon \ | ||
&& mkdir -p /etc/horizon/agbot/policy.d /etc/horizon/policy.d /etc/horizon/trust /etc/docker/certs.d \ | ||
&& adduser agentuser -u 1000 -U -f -1 -c "agent user,1,2,3" | ||
|
||
# add license file | ||
COPY LICENSE.txt /licenses | ||
|
||
COPY script/* /home/agentuser/ | ||
COPY config/* /etc/horizon/ | ||
|
||
ADD anax /usr/horizon/bin/ | ||
ADD hzn /usr/bin/ | ||
|
||
RUN chown -R agentuser:agentuser /home/agentuser /etc/horizon | ||
|
||
USER agentuser | ||
WORKDIR /home/agentuser | ||
RUN mkdir -p /home/agentuser/policy.d | ||
|
||
ENTRYPOINT ["/home/agentuser/anax.service", "start"] |