Giter VIP home page Giter VIP logo

Comments (2)

hoeghh avatar hoeghh commented on June 11, 2024

I suggest we create/generate a ktew.env file. Use the same name on each host. The file will tell the what kind of node it should install, and all the information it needs.

from kubernetes_the_easy_way.

hoeghh avatar hoeghh commented on June 11, 2024

json for etcd test

{
	"type": "etcd",
	"hostname": "k8s-etcd-03",
	"install": {
		"type": "remote",
		"location": "https://lighthouse.net:8000/clusters/4/k8s-etcd-01"
	},
	"etcd_cluster": [{
			"hostname": "k8s-etcd-01",
			"ip": "192.168.0.25",
			"version": "v3.2.11",
			"status": "not-ready"
		},
		{
			"hostname": "k8s-etcd-02",
			"ip": "192.168.0.26",
			"version": "v3.2.11",
			"status": "ready"
		},
		{
			"hostname": "k8s-etcd-03",
			"ip": "192.168.0.27",
			"version": "v3.2.11",
			"status": "ready"
		}
	]
}

Getting data we need :

export my_hostname=$(cat etcd.json | jq '.hostname' | tr -d \")
export my_ip=$(cat etcd.json | jq '.etcd_cluster[] | select (.hostname=="'$my_hostname'") | .ip' | tr -d \")

export other_ips=$(cat etcd.json | jq '.etcd_cluster[] | select (.hostname=="'$my_hostname'" | not) | .ip' | tr -d \" | tr '\n' ',' |  sed 's/,$//g')

export cluster_list=$(cat etcd.json | jq '.etcd_cluster[] | " \(.hostname)=https://\(.ip)"' | tr -d \" | tr '\n' ',' |  sed 's/,$//g')

from kubernetes_the_easy_way.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.