Quick Start, Minikube Jenkins
minikube
> minikube start
π Microsoft Windows 11 Pro 10.0.26100.2605 Build 26100.2605 μ minikube v1.34.0
π minikube 1.35.0 μ΄ μ¬μ©κ°λ₯ν©λλ€! λ€μ κ²½λ‘μμ λ€μ΄λ°μΌμΈμ: https://github.com/kubernetes/minikube/releases/tag/v1.35.0
π‘ ν΄λΉ μλ¦Όμ λΉνμ±ννλ €λ©΄ λ€μ λͺ
λ Ήμ΄λ₯Ό μ€ννμΈμ. 'minikube config set WantUpdateNotification false'
β¨ μ μ νκ²½ μ€μ μ 보μ κΈ°λ°νμ¬ docker λλΌμ΄λ²λ₯Ό μ¬μ©νλ μ€
π Using Docker Desktop driver with root privileges
π Starting "minikube" primary control-plane node in "minikube" cluster
π Pulling base image v0.0.45 ...
π₯ Creating docker container (CPUs=2, Memory=4000MB) ...
β Failing to connect to https://registry.k8s.io/ from inside the minikube container
π‘ To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
π³ μΏ λ²λ€ν°μ€ v1.31.0 μ Docker 27.2.0 λ°νμμΌλ‘ μ€μΉνλ μ€
βͺ μΈμ¦μ λ° ν€λ₯Ό μμ±νλ μ€ ...
βͺ 컨νΈλ‘€ νλ μΈμ λΆν
νλ μ€ ...
βͺ RBAC κ·μΉμ ꡬμ±νλ μ€ ...
π bridge CNI (Container Networking Interface) λ₯Ό ꡬμ±νλ μ€ ...
π Kubernetes κ΅¬μ± μμλ₯Ό νμΈ...
βͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
π μ λμ¨ νμ±ν : storage-provisioner, default-storageclass
π λλ¬μ΅λλ€! kubectlμ΄ "minikube" ν΄λ¬μ€ν°μ "default" λ€μμ€νμ΄μ€λ₯Ό κΈ°λ³Έμ μΌλ‘ μ¬μ©νλλ‘ κ΅¬μ±λμμ΅λλ€.
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
minikube service argocd-server -n argocd
argocd admin initial-password -n argocd
- Create Namespace
argocd
- Installation
argocd
toKubernetes
- Launch a ArgoCD Applications and Services
- Find out argocd
password
- Access a ArgoCD portal with id:
admin
, password
> kubectl create namespace argocd
namespace/argocd created
> kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
customresourcedefinition.apiextensions.k8s.io/applications.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/applicationsets.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/appprojects.argoproj.io created
serviceaccount/argocd-application-controller created
serviceaccount/argocd-applicationset-controller created
serviceaccount/argocd-dex-server created
serviceaccount/argocd-notifications-controller created
serviceaccount/argocd-redis created
serviceaccount/argocd-repo-server created
serviceaccount/argocd-server created
role.rbac.authorization.k8s.io/argocd-application-controller created
role.rbac.authorization.k8s.io/argocd-applicationset-controller created
role.rbac.authorization.k8s.io/argocd-dex-server created
role.rbac.authorization.k8s.io/argocd-notifications-controller created
role.rbac.authorization.k8s.io/argocd-redis created
role.rbac.authorization.k8s.io/argocd-server created
clusterrole.rbac.authorization.k8s.io/argocd-application-controller created
clusterrole.rbac.authorization.k8s.io/argocd-applicationset-controller created
clusterrole.rbac.authorization.k8s.io/argocd-server created
rolebinding.rbac.authorization.k8s.io/argocd-application-controller created
rolebinding.rbac.authorization.k8s.io/argocd-applicationset-controller created
rolebinding.rbac.authorization.k8s.io/argocd-dex-server created
rolebinding.rbac.authorization.k8s.io/argocd-notifications-controller created
rolebinding.rbac.authorization.k8s.io/argocd-redis created
rolebinding.rbac.authorization.k8s.io/argocd-server created
clusterrolebinding.rbac.authorization.k8s.io/argocd-application-controller created
clusterrolebinding.rbac.authorization.k8s.io/argocd-applicationset-controller created
clusterrolebinding.rbac.authorization.k8s.io/argocd-server created
configmap/argocd-cm created
configmap/argocd-cmd-params-cm created
configmap/argocd-gpg-keys-cm created
configmap/argocd-notifications-cm created
configmap/argocd-rbac-cm created
configmap/argocd-ssh-known-hosts-cm created
configmap/argocd-tls-certs-cm created
secret/argocd-notifications-secret created
secret/argocd-secret created
service/argocd-applicationset-controller created
service/argocd-dex-server created
service/argocd-metrics created
service/argocd-notifications-controller-metrics created
service/argocd-redis created
service/argocd-repo-server created
service/argocd-server created
service/argocd-server-metrics created
deployment.apps/argocd-applicationset-controller created
deployment.apps/argocd-dex-server created
deployment.apps/argocd-notifications-controller created
deployment.apps/argocd-redis created
deployment.apps/argocd-repo-server created
deployment.apps/argocd-server created
statefulset.apps/argocd-application-controller created
networkpolicy.networking.k8s.io/argocd-application-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-applicationset-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-dex-server-network-policy created
networkpolicy.networking.k8s.io/argocd-notifications-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-redis-network-policy created
networkpolicy.networking.k8s.io/argocd-repo-server-network-policy created
networkpolicy.networking.k8s.io/argocd-server-network-policy created
> minikube service argocd-server -n argocd
|-----------|---------------|-------------|--------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-----------|---------------|-------------|--------------|
| argocd | argocd-server | | No node port |
|-----------|---------------|-------------|--------------|
πΏ service argocd/argocd-server has no node port
β Services [argocd/argocd-server] have type "ClusterIP" not meant to be exposed, however for local development minikube allows you to access this !
π argocd-server μλΉμ€μ ν°λμ μμνλ μ€
|-----------|---------------|-------------|-----------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-----------|---------------|-------------|-----------------------|
| argocd | argocd-server | | http://127.0.0.1:3562 |
| | | | http://127.0.0.1:3563 |
|-----------|---------------|-------------|-----------------------|
[argocd argocd-server http://127.0.0.1:3562
http://127.0.0.1:3563]
β windows μμ Docker λλΌμ΄λ²λ₯Ό μ¬μ©νκ³ μκΈ° λλ¬Έμ, ν°λ―Έλμ μ΄μ΄μΌ μ€νν μ μμ΅λλ€
> argocd admin initial-password -n argocd
RqLz4K3bf9nKy10x
This password must be only used for first time login. We strongly recommend you update the password using `argocd account update-password`.
- Login to ArgoCD
- Applications >
+ New APP
Fill-in
- (GENERAL) Application Name:
jenkins
- (GENERAL) Project Name:
default
- (SOURCE) Repository URL:
https://github.com/pushdown99/argo-jenkins.git
- (SOURCE) Path:
app
- (DESTINATION) Cluster URL:
https://kubernetes.default.svc
- (DESTINATION) Namespace:
default
- (GENERAL) Application Name:
Create
SYNC
kubectl
commands
> minikube service jenkins-service -n jenkins
|-----------|-----------------|-------------|---------------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-----------|-----------------|-------------|---------------------------|
| jenkins | jenkins-service | 8080 | http://192.168.49.2:32000 |
|-----------|-----------------|-------------|---------------------------|
π jenkins-service μλΉμ€μ ν°λμ μμνλ μ€
|-----------|-----------------|-------------|-----------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-----------|-----------------|-------------|-----------------------|
| jenkins | jenkins-service | | http://127.0.0.1:5032 |
|-----------|-----------------|-------------|-----------------------|
π Opening service jenkins/jenkins-service in default browser...
β windows μμ Docker λλΌμ΄λ²λ₯Ό μ¬μ©νκ³ μκΈ° λλ¬Έμ, ν°λ―Έλμ μ΄μ΄μΌ μ€νν μ μμ΅λλ€
> kubectl get pod -n jenkins | grep jenkins | cut -d' ' -f1
jenkins-7c6f896bf4-452pm
> kubectl -n jenkins exec -it jenkins-7c6f896bf4-452pm -- /bin/bash -c "cat /var/jenkins_home/secrets/initialAdminPassword"
c96863d320e84299b1a51cff74ee5781
> kubectl -n jenkins exec -it jenkins-7c6f896bf4-452pm -- /bin/bash
jenkins@jenkins-7c6f896bf4-452pm:/$ cd /var/jenkins_home
jenkins@jenkins-7c6f896bf4-452pm:~$ mkdir .ssh
jenkins@jenkins-7c6f896bf4-452pm:~$ cd .ssh
jenkins@jenkins-7c6f896bf4-452pm:~/.ssh$ cd /var/jenkins_home
jenkins@jenkins-7c6f896bf4-452pm:~/.ssh$ ssh-keygen -t rsa -b 4096 -C test-key -f github_jenkins
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in github_jenkins
Your public key has been saved in github_jenkins.pub
The key fingerprint is:
SHA256:4Itu7DuptuRBct53PEf9d9LsH2mWd0VlJKEzThZOrzg test-key
The key's randomart image is:
+---[RSA 4096]----+
| o oo+|
| o + o.|
| . B . .|
| . . * + . |
|. o . S E + .|
| = . . o . . . o+|
| +.o.o + . o*B|
| o.o=. . o o+=|
| .+=+o +|
+----[SHA256]-----+
jenkins@jenkins-7c6f896bf4-452pm:~/.ssh$
jenkins@jenkins-7c6f896bf4-452pm:~/.ssh$ ls
github_jenkins github_jenkins.pub
Register SSH key (public key) to Github Repositories
- Goto github repositories (https://github.com/pushdown99/jenkins-webhook)
- Settings > General/Security/Deploy keys => [
Add deploy key
] - Deploy keys/Add new => Title: github_jenkins, Key: (cat github_jenkins.pub) => [
Add key
]
Register SSH key (private key) to Jenkins Credentials
- Goto Jenkins dashboard (ex: http://127.0.0.1:5022)
- Dashboard >
+ New Item
=> New Item / Name:github_jenkins
Type:Freestyle project
- Dashboard > Name:
github_jenkins
=> Source code management => Git/Repository URL:git@github.com:pushdown99/jenkins-test.git
, Credentials/ Add:github_jenkins
=> Kind:SSH Username with private key
, Username:github_jenkins
, Private key/Enterdirectly: (cat github_jenkins) => [Add
]
Build Trigger
- Build Trigger / [
v
] Github hook trigger for GITScm polling
- Build Trigger / [
Plugin Installation
- Jenkins Management > Plugins > Available plugins >
GitHub Integration Plugin
: Install
- Jenkins Management > Plugins > Available plugins >
Ngrok Installation (optional: localhost)