.
This commit is contained in:
@@ -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
|
||||
2
kaniko/README.md
Normal file
2
kaniko/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# Kaniko
|
||||
## Kaniko can be used to automate docker image creation
|
||||
54
kaniko/kaniko.yaml
Normal file
54
kaniko/kaniko.yaml
Normal file
@@ -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: |
|
||||
<html>
|
||||
<head><title>Kaniko Test</title></head>
|
||||
<body>
|
||||
<h1>Hello from Kaniko</h1>
|
||||
<p>This image was built inside Kubernetes and pushed to Harbor.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
---
|
||||
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
|
||||
4
kaniko/namespace.yaml
Normal file
4
kaniko/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: kaniko
|
||||
18
kaniko/secrets.yaml
Normal file
18
kaniko/secrets.yaml
Normal file
@@ -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=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# KUNUNU
|
||||
## kununu can be used to automate docker image creation
|
||||
Reference in New Issue
Block a user