From 2296921364bac465dc09a4ccb2628469d4d52784 Mon Sep 17 00:00:00 2001 From: shodan Date: Tue, 24 Mar 2026 18:15:23 +0000 Subject: [PATCH] . --- app-of-apps/{kununu.yaml => kaniko.yaml} | 6 +-- kaniko/README.md | 2 + kaniko/kaniko.yaml | 54 ++++++++++++++++++++++++ kaniko/namespace.yaml | 4 ++ kaniko/secrets.yaml | 18 ++++++++ kununu/README.md | 2 - 6 files changed, 81 insertions(+), 5 deletions(-) rename app-of-apps/{kununu.yaml => kaniko.yaml} (86%) create mode 100644 kaniko/README.md create mode 100644 kaniko/kaniko.yaml create mode 100644 kaniko/namespace.yaml create mode 100644 kaniko/secrets.yaml delete mode 100644 kununu/README.md diff --git a/app-of-apps/kununu.yaml b/app-of-apps/kaniko.yaml similarity index 86% rename from app-of-apps/kununu.yaml rename to app-of-apps/kaniko.yaml index fb1eec0..4200220 100644 --- a/app-of-apps/kununu.yaml +++ b/app-of-apps/kaniko.yaml @@ -1,16 +1,16 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: kununu + name: kaniko namespace: argocd finalizers: - resources-finalizer.argocd.argoproj.io spec: destination: - namespace: kununu + namespace: kaniko server: https://kubernetes.default.svc project: default source: - path: kununu + path: kaniko repoURL: http://gitea.gitea.svc.k8s.undercloud.local:3000/Undercloud/k8s-apps.git targetRevision: HEAD \ No newline at end of file diff --git a/kaniko/README.md b/kaniko/README.md new file mode 100644 index 0000000..9c6fa7e --- /dev/null +++ b/kaniko/README.md @@ -0,0 +1,2 @@ +# Kaniko +## Kaniko can be used to automate docker image creation \ No newline at end of file diff --git a/kaniko/kaniko.yaml b/kaniko/kaniko.yaml new file mode 100644 index 0000000..0d08cb0 --- /dev/null +++ b/kaniko/kaniko.yaml @@ -0,0 +1,54 @@ + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: kaniko-build-context + namespace: kaniko +data: + Dockerfile: | + FROM nginx:stable + COPY index.html /usr/share/nginx/html/index.html + index.html: | + + Kaniko Test + +

Hello from Kaniko

+

This image was built inside Kubernetes and pushed to Harbor.

+ + + +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: kaniko-build-to-harbor + namespace: kaniko +spec: + backoffLimit: 0 + template: + spec: + restartPolicy: Never + containers: + - name: kaniko + image: gcr.io/kaniko-project/executor:v1.23.2 + args: + - --context=dir:///workspace + - --dockerfile=/workspace/Dockerfile + - --destination=docker-repo.apps.undercloud.dev/library/kaniko-demo:latest + - --cleanup + volumeMounts: + - name: build-context + mountPath: /workspace + - name: docker-config + mountPath: /kaniko/.docker + volumes: + - name: build-context + configMap: + name: kaniko-build-context + - name: docker-config + secret: + secretName: harbor-creds + items: + - key: .dockerconfigjson + path: config.json \ No newline at end of file diff --git a/kaniko/namespace.yaml b/kaniko/namespace.yaml new file mode 100644 index 0000000..d92b315 --- /dev/null +++ b/kaniko/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: kaniko \ No newline at end of file diff --git a/kaniko/secrets.yaml b/kaniko/secrets.yaml new file mode 100644 index 0000000..d88fba8 --- /dev/null +++ b/kaniko/secrets.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: v1 +kind: Secret +metadata: + name: harbor-creds + namespace: kaniko +type: kubernetes.io/dockerconfigjson +stringData: + .dockerconfigjson: | + { + "auths": { + "docker-repo.apps.undercloud.dev": { + "username": "admin", + "password": "4IsTheMindKiller", + "auth": "YWRtaW46UkVQTEFDRV9NRQ==" + } + } + } diff --git a/kununu/README.md b/kununu/README.md deleted file mode 100644 index 505a1b0..0000000 --- a/kununu/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# KUNUNU -## kununu can be used to automate docker image creation \ No newline at end of file