This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo tee /etc/apt/sources.list.d/mongodb-org.list << EOF | |
| deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse | |
| EOF | |
| sudo tee /etc/apt/sources.list.d/openvpn.list << EOF | |
| deb [ signed-by=/usr/share/keyrings/openvpn-repo.gpg ] https://build.openvpn.net/debian/openvpn/stable noble main | |
| EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo su - | |
| wget https://github.com/containerd/containerd/releases/download/v1.6.8/containerd-1.6.8-linux-amd64.tar.gz | |
| tar Cxzvf /usr/local containerd-1.6.8-linux-amd64.tar.gz | |
| wget https://github.com/opencontainers/runc/releases/download/v1.1.3/runc.amd64 | |
| install -m 755 runc.amd64 /usr/local/sbin/runc | |
| wget https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## first taint on node## | |
| ## kubectl taint nodes node01 pod=allow:NoSchedule | |
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| labels: | |
| run: nginx | |
| name: nginx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: PersistentVolume | |
| metadata: | |
| name: my-pv | |
| spec: | |
| capacity: | |
| storage: 2Gi | |
| volumeMode: Filesystem | |
| accessModes: | |
| - ReadWriteOnce |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| name: multi | |
| spec: | |
| containers: | |
| - name: web | |
| image: nginx:alpine | |
| env: | |
| - name: NODE_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| upstream loadbalance { | |
| server 10.154.0.4:5001; | |
| server 10.154.0.4:5002; | |
| } | |
| server { | |
| location / { | |
| proxy_pass http://loadbalance; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import request, Flask | |
| import json | |
| app2 = Flask(__name__) | |
| @app2.route('/') | |
| def hello_world(): | |
| return 'this is response from app2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import request, Flask | |
| import json | |
| app1 = Flask(__name__) | |
| @app1.route('/') | |
| def hello_world(): | |
| return 'this is response from app1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Install docker | |
| hosts: swarm_hosts | |
| become: true | |
| tasks: | |
| - name: Install pre-requisite packages | |
| yum: | |
| name: "{{item}}" | |
| state: latest | |
| loop: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: networking.k8s.io/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: webapp-ingress | |
| namespace: app | |
| annotations: | |
| kubernetes.io/ingress.class: nginx | |
| nginx.ingress.kubernetes.io/ssl-redirect: "false" | |
| nginx.ingress.kubernetes.io/use-regex: "true" | |
| nginx.ingress.kubernetes.io/rewrite-target: /$1 |
NewerOlder