Skip to content

Commit 43a0b09

Browse files
ansible
1 parent 790ee00 commit 43a0b09

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed

helm/OCI_registry_setup

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
OCI registry setup :-
2+
3+
1) Create directory named OCI inside /usr/local/
4+
5+
2) Create subdirectory named :- auth registry_data ssl inside OCI directory
6+
7+
8+
3) Create htpasswd file in auth folder using below command :-
9+
10+
htpasswd -cB htpasswd pivotchain
11+
12+
4) Add ssl certificates inside ssl folder.
13+
14+
5) OCI registry up command :-
15+
16+
docker run -d -p 5000:5000 --restart=always --name oci-registry -v /usr/local/OCI/auth:/auth -v /usr/local/OCI/registry_data:/var/lib/registry -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd -v /usr/local/OCI/ssl/:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/boringproxy_xyz_chain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/server.key registry
17+
18+
19+
6) Important commands. :-
20+
21+
helm registry login -u pivotchain boringproxy.xyz:5000
22+
23+
helm registry logout boringproxy.xyz:5000
24+
25+
helm push firstchart-0.1.0.tgz oci:// boringproxy.xyz:5000/helm-charts
26+
27+
helm show all oci:// boringproxy.xyz:5000/helm-charts/firstchart --version 0.1.0
28+
29+
helm pull oci:// boringproxy.xyz:5000/helm-charts/firstchart --version 0.1.0
30+
31+
helm template myrelease oci:// boringproxy.xyz:5000/helm-charts/firstchart --version 0.1.0
32+
33+
helm install myrelease oci:// boringproxy.xyz:5000/helm-charts/firstchart --version 0.1.0
34+
35+
helm upgrade myrelease oci:// boringproxy.xyz:5000/helm-charts/firstchart --version 0.2.0
36+
37+
38+
39+
40+

helm/helm-commands

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
Installation:
2+
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add
3+
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
4+
apt-get update
5+
apt-get install helm
6+
helm version
7+
8+
helm create raven
9+
helm install raven ./raven/ --dry-run
10+
helm install raven ./raven/
11+
12+
13+
helm dependency build
14+
helm dependency update
15+
16+
helm install -f values.yaml raven .
17+
18+
19+
How to create helm chart and upload it to private repo:
20+
- helm plugin install https://github.com/hypnoglow/helm-s3.git
21+
- helm plugin list
22+
- helm s3 version --mode
23+
create one bucket on aws side for example : -->> helm.devopsbyexample.io
24+
- helm s3 init s3://helm.devopsbyexample.io/charts
25+
- helm repo add private s3://helm.devopsbyexample.io/charts
26+
- helm repo list
27+
- helm create hello-world
28+
- helm package hello-world
29+
- helm s3 push --relative ./hello-world-0.1.0.tgz private
30+
- helm search repo private
31+
- helm install -n default hello-world private/hello-world --version 0.1.0
32+
- helm ls -n default
33+
34+
35+
36+
37+
CREATE REPO FOR HELM USING NGINX HTTPS SERVER:
38+
Execute command on web0server:
39+
sudo mkdir /var/www/html/charts
40+
sudo nano /etc/nginx/nginx.conf
41+
server {
42+
listen 80;
43+
server_name example.com; # Replace with your domain name or server IP
44+
45+
location / {
46+
root /var/www/html;
47+
index index.html;
48+
}
49+
50+
location /charts {
51+
alias /var/www/html/charts;
52+
autoindex on;
53+
}
54+
}
55+
56+
57+
sudo systemctl restart nginx
58+
59+
60+
61+
62+
63+
ON REMOTE MACHINE
64+
helm package .
65+
SCP TAR : to WEBSERVER AT PATH: /var/www/html/charts
66+
67+
ON ANOTHER REMOTE MACHINE
68+
helm repo add myrepo https://boringproxy.xyz/charts
69+
helm repo update
70+
helm install raven myrepo/baseservices
71+
72+
#####################################################################################
73+
74+
OCI registry setup :-
75+
76+
1) Create directory named OCI inside /usr/local/
77+
78+
2) Create subdirectory named :- auth registry_data ssl inside OCI directory
79+
80+
81+
3) Create htpasswd file in auth folder using below command :-
82+
83+
htpasswd -cB htpasswd pivotchain
84+
85+
4) Add ssl certificates inside ssl folder.
86+
87+
5) OCI registry up command :-
88+
89+
docker run -d -p 5000:5000 --restart=always --name oci-registry -v /usr/local/OCI/auth:/auth -v /usr/local/OCI/registry_data:/var/lib/registry -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd -v /usr/local/OCI/ssl/:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/boringproxy_xyz_chain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/server.key registry
90+
91+
92+
6) Important commands. :-
93+
94+
cd to chart
95+
helm package . ### It will create one tar file with version number.
96+
helm registry login -u pivotchain boringproxy.xyz:5000
97+
helm push baseservices-0.1.0.tgz oci://boringproxy.xyz:5000/helm-charts
98+
helm show all oci://boringproxy.xyz:5000/helm-charts/baseservices --version 0.1.0
99+
100+
101+
helm registry login -u pivotchain boringproxy.xyz:5000
102+
helm install raven oci://boringproxy.xyz:5000/helm-charts/baseservices --version 0.1.0
103+
104+
105+
106+

0 commit comments

Comments
 (0)