mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +00:00 
			
		
		
		
	Updating federation up scripts to work in non e2e setup
This commit is contained in:
		@@ -46,7 +46,7 @@ if [[ -z "${FEDERATION_PUSH_REPO_BASE}" ]]; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FEDERATION_IMAGE_REPO_BASE=${FEDERATION_IMAGE_REPO_BASE:-'gcr.io/google_containers'}
 | 
					FEDERATION_IMAGE_REPO_BASE=${FEDERATION_IMAGE_REPO_BASE:-'gcr.io/google_containers'}
 | 
				
			||||||
FEDERATION_NAMESPACE=${FEDERATION_NAMESPACE:-federation-e2e}
 | 
					FEDERATION_NAMESPACE=${FEDERATION_NAMESPACE:-federation}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
KUBE_PLATFORM=${KUBE_PLATFORM:-linux}
 | 
					KUBE_PLATFORM=${KUBE_PLATFORM:-linux}
 | 
				
			||||||
KUBE_ARCH=${KUBE_ARCH:-amd64}
 | 
					KUBE_ARCH=${KUBE_ARCH:-amd64}
 | 
				
			||||||
@@ -98,7 +98,7 @@ function create-federation-api-objects {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    FEDERATION_KUBECONFIG_PATH="${KUBE_ROOT}/federation/cluster/kubeconfig"
 | 
					    FEDERATION_KUBECONFIG_PATH="${KUBE_ROOT}/federation/cluster/kubeconfig"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    federation_kubectl="${KUBE_ROOT}/cluster/kubectl.sh --context=federated-cluster --namespace=default"
 | 
					    federation_kubectl="${KUBE_ROOT}/cluster/kubectl.sh --context=federation-cluster --namespace=default"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    manifests_root="${KUBE_ROOT}/federation/manifests/"
 | 
					    manifests_root="${KUBE_ROOT}/federation/manifests/"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -151,7 +151,7 @@ function create-federation-api-objects {
 | 
				
			|||||||
    # controller manager can use to talk to the federation-apiserver.
 | 
					    # controller manager can use to talk to the federation-apiserver.
 | 
				
			||||||
    # Note that the file name should be "kubeconfig" so that the secret key gets the same name.
 | 
					    # Note that the file name should be "kubeconfig" so that the secret key gets the same name.
 | 
				
			||||||
    KUBECONFIG_DIR=$(dirname ${KUBECONFIG:-$DEFAULT_KUBECONFIG})
 | 
					    KUBECONFIG_DIR=$(dirname ${KUBECONFIG:-$DEFAULT_KUBECONFIG})
 | 
				
			||||||
    CONTEXT=federated-cluster \
 | 
					    CONTEXT=federation-cluster \
 | 
				
			||||||
	   KUBE_BEARER_TOKEN="$FEDERATION_API_TOKEN" \
 | 
						   KUBE_BEARER_TOKEN="$FEDERATION_API_TOKEN" \
 | 
				
			||||||
           KUBECONFIG="${KUBECONFIG_DIR}/federation/federation-apiserver/kubeconfig" \
 | 
					           KUBECONFIG="${KUBECONFIG_DIR}/federation/federation-apiserver/kubeconfig" \
 | 
				
			||||||
	   create-kubeconfig
 | 
						   create-kubeconfig
 | 
				
			||||||
@@ -168,7 +168,7 @@ function create-federation-api-objects {
 | 
				
			|||||||
    done
 | 
					    done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Update the users kubeconfig to include federation-apiserver credentials.
 | 
					    # Update the users kubeconfig to include federation-apiserver credentials.
 | 
				
			||||||
    CONTEXT=federated-cluster \
 | 
					    CONTEXT=federation-cluster \
 | 
				
			||||||
	   KUBE_BEARER_TOKEN="$FEDERATION_API_TOKEN" \
 | 
						   KUBE_BEARER_TOKEN="$FEDERATION_API_TOKEN" \
 | 
				
			||||||
	   SECONDARY_KUBECONFIG=true \
 | 
						   SECONDARY_KUBECONFIG=true \
 | 
				
			||||||
	   create-kubeconfig
 | 
						   create-kubeconfig
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,4 +22,8 @@ KUBE_ROOT=$(readlink -m $(dirname "${BASH_SOURCE}")/../../)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
. ${KUBE_ROOT}/federation/cluster/common.sh
 | 
					. ${KUBE_ROOT}/federation/cluster/common.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ -f "${KUBE_ROOT}/federation/manifests/federated-image.tag" ]]; then
 | 
				
			||||||
 | 
					    export FEDERATION_IMAGE_TAG="$(cat "${KUBE_ROOT}/federation/manifests/federated-image.tag")"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
create-federation-api-objects
 | 
					create-federation-api-objects
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -64,7 +64,7 @@ func main() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func templateYamlFile(params map[string]string, inpath string, out io.Writer) error {
 | 
					func templateYamlFile(params map[string]string, inpath string, out io.Writer) error {
 | 
				
			||||||
	if tmpl, err := template.New(path.Base(inpath)).ParseFiles(inpath); err != nil {
 | 
						if tmpl, err := template.New(path.Base(inpath)).Option("missingkey=zero").ParseFiles(inpath); err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		if err := tmpl.Execute(out, params); err != nil {
 | 
							if err := tmpl.Execute(out, params); err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user