-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Kubernetes specific container images
This commit adds container files with just kubernetes client and removes the label as part of CNCF onboarding. Signed-off-by: Naga Ravi Chaitanya Elluri <[email protected]>
- Loading branch information
1 parent
83c6058
commit 331ea63
Showing
5 changed files
with
111 additions
and
7 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,30 @@ | ||
# Dockerfile for kraken | ||
|
||
FROM mcr.microsoft.com/azure-cli:latest as azure-cli | ||
|
||
FROM registry.access.redhat.com/ubi8/ubi:latest | ||
|
||
LABEL org.opencontainers.image.authors="Red Hat OpenShift Chaos Engineering" | ||
|
||
ENV KUBECONFIG /root/.kube/config | ||
|
||
# Copy azure client binary from azure-cli image | ||
COPY --from=azure-cli /usr/local/bin/az /usr/bin/az | ||
|
||
# Install dependencies | ||
RUN yum install -y git python39 python3-pip jq gettext wget && \ | ||
python3.9 -m pip install -U pip && \ | ||
git clone https://github.com/redhat-chaos/krkn.git --branch v1.5.2 /root/kraken && \ | ||
mkdir -p /root/.kube && cd /root/kraken && \ | ||
pip3.9 install -r requirements.txt && \ | ||
pip3.9 install virtualenv && \ | ||
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq | ||
|
||
# Get Kubernetes and OpenShift clients from stable releases | ||
WORKDIR /tmp | ||
RUN wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz && tar -xvf openshift-client-linux.tar.gz && cp oc /usr/local/bin/oc && cp kubectl /usr/local/bin/kubectl | ||
|
||
WORKDIR /root/kraken | ||
|
||
ENTRYPOINT ["python3.9", "run_kraken.py"] | ||
CMD ["--config=config/config.yaml"] |
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,29 @@ | ||
# Dockerfile for kraken | ||
|
||
FROM ppc64le/centos:8 | ||
|
||
FROM mcr.microsoft.com/azure-cli:latest as azure-cli | ||
|
||
LABEL org.opencontainers.image.authors="Red Hat OpenShift Chaos Engineering" | ||
|
||
ENV KUBECONFIG /root/.kube/config | ||
|
||
# Copy azure client binary from azure-cli image | ||
COPY --from=azure-cli /usr/local/bin/az /usr/bin/az | ||
|
||
# Install dependencies | ||
RUN yum install -y git python39 python3-pip jq gettext wget && \ | ||
python3.9 -m pip install -U pip && \ | ||
git clone https://github.com/redhat-chaos/krkn.git --branch v1.5.2 /root/kraken && \ | ||
mkdir -p /root/.kube && cd /root/kraken && \ | ||
pip3.9 install -r requirements.txt && \ | ||
pip3.9 install virtualenv && \ | ||
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq | ||
|
||
# Get Kubernetes and OpenShift clients from stable releases | ||
WORKDIR /tmp | ||
RUN wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz && tar -xvf openshift-client-linux.tar.gz && cp oc /usr/local/bin/oc && cp kubectl /usr/local/bin/kubectl | ||
|
||
WORKDIR /root/kraken | ||
|
||
ENTRYPOINT python3.9 run_kraken.py --config=config/config.yaml |
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,49 @@ | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: kraken | ||
spec: | ||
parallelism: 1 | ||
completions: 1 | ||
template: | ||
metadata: | ||
labels: | ||
tool: Kraken | ||
spec: | ||
serviceAccountName: useroot | ||
containers: | ||
- name: kraken | ||
securityContext: | ||
privileged: true | ||
image: quay.io/redhat-chaos/krkn | ||
command: ["/bin/sh", "-c"] | ||
args: ["python3.9 run_kraken.py -c config/config.yaml"] | ||
volumeMounts: | ||
- mountPath: "/root/.kube" | ||
name: config | ||
- mountPath: "/root/kraken/config" | ||
name: kraken-config | ||
- mountPath: "/root/kraken/scenarios" | ||
name: scenarios-config | ||
- mountPath: "/root/kraken/scenarios/openshift" | ||
name: scenarios-openshift-config | ||
- mountPath: "/root/kraken/scenarios/kube" | ||
name: scenarios-kube-config | ||
restartPolicy: Never | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: kube-config | ||
- name: kraken-config | ||
configMap: | ||
name: kraken-config | ||
- name: scenarios-config | ||
configMap: | ||
name: scenarios-config | ||
- name: scenarios-openshift-config | ||
configMap: | ||
name: scenarios-openshift-config | ||
- name: scenarios-kube-config | ||
configMap: | ||
name: scenarios-kube-config |