34
loading...
This website collects cookies to deliver better user experience
docker.registry.private
, so we can edit /etc/hosts
on each node to map this hostname to the current node.192.168.1.244 rpi-1 docker.registry.private
192.168.1.245 rpi-2
192.168.1.246 rpi-3
/etc/rancher/k3s/registries.yaml
on each node:mirrors:
docker.registry.private:
endpoint:
- "https://docker.registry.private"
configs:
"docker.registry.private":
auth:
username: registry
password: <replace-with-your-password>
tls:
insecure_skip_verify: true
/etc/rancher/node
, but registries.yaml
is only recognized from /etc/rancher/k3s
, so you will need to create this directory first.tls
section to trust the self-signed certificate presented by registry’s ingress, so specifying insecure_skip_verify: true
disables certificate verification for now.# Master node
sudo chmod go-r /etc/rancher/k3s/registries.yaml
sudo systemctl restart k3s
# Worker nodes
sudo chmod go-r /etc/rancher/k3s/registries.yaml
sudo systemctl restart k3s-node
docker.registry.private
. Assuming we pushed the image arm32v7/nginx
to our registry, we can deploy the following pod:apiVersion: v1
kind: Pod
metadata:
name: docker-registry-test
spec:
containers:
- name: nginx
image: docker.registry.private/arm32v7/nginx
arm64
, but the images under jenkins4eval
do, so using jenkins4eval/jenkins:latest
ended up working.jenkins.private
and then mapped this hostname to the master node in /etc/hosts
on my laptop. This follows the same approach for how I’m accessing other services from my laptop, such as Longhorn UI and the private registry.https://jenkins.private
, you will be prompted to unlock Jenkins. The password is printed to the log of the Jenkins pod during start up. The above articles cover this in more detail.ClusterIP
service that we created as part of deploying Jenkins, so the URL should be http://jenkins:8080
.default-agent
. This is the name of a pod template we are going to create to provide default values for all worker pods. The main reason we are defining a pod template is to override the default jnlp
container to a specific one that supports arm64.
default-agent
and the namespace as jenkins
:jnlp
and specify the image as pi4k8s/inbound-agent:4.3
:k3s-test-pipleine
. Under the Pipeline Definition, select Pipeline Script
and enter the following script:pipeline {
agent {
kubernetes {
defaultContainer 'jnlp'
}
}
stages {
stage('Hello') {
steps {
echo 'Hello everyone! This is now running on a Kubernetes executor!'
}
}
}
}
34