-
Notifications
You must be signed in to change notification settings - Fork 2
/
rosa.makefile
58 lines (47 loc) · 2.18 KB
/
rosa.makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
CLUSTER_NAME?=sapeic
.PHONY: rosa-login
rosa-login: ## Login using ROSA token
$(call required-environment-variables,ROSA_TOKEN)
@rosa login --token="${ROSA_TOKEN}"
.PHONY: rosa-init
rosa-init: ## ROSA init
rosa init
.PHONY: rosa-account-roles
rosa-account-roles: ## Login using ROSA token
rosa create account-roles --mode auto
.PHONY: rosa-cluster
rosa-cluster: ## Create ROSA cluster
$(call required-environment-variables,ROSA_TOKEN CLUSTER_NAME)
rosa create cluster --cluster-name "${CLUSTER_NAME}"
.PHONY: rosa-cluster-status
rosa-cluster-status: ## Get ROSA cluster status
$(call required-environment-variables,ROSA_TOKEN CLUSTER_NAME)
rosa describe cluster --cluster "${CLUSTER_NAME}"
.PHONY: rosa-cluster-hibernate
rosa-cluster-hibernate: ## Hibernate ROSA cluster
$(call required-environment-variables,ROSA_TOKEN CLUSTER_NAME)
rosa hibernate cluster --cluster "${CLUSTER_NAME}"
.PHONY: rosa-cluster-resume
rosa-cluster-resume: ## Resume ROSA cluster
$(call required-environment-variables,ROSA_TOKEN CLUSTER_NAME)
rosa resume cluster --cluster "${CLUSTER_NAME}"
.PHONY: rosa-cluster-delete
rosa-cluster-delete: ## Delete ROSA cluster
$(call required-environment-variables,ROSA_TOKEN CLUSTER_NAME)
rosa delete cluster --cluster "${CLUSTER_NAME}"
.PHONY: rosa-cluster-admin
rosa-cluster-admin: ## Create cluster admin
$(call required-environment-variables,ROSA_TOKEN CLUSTER_NAME CLUSTER_ADMIN_PASSWORD)
@rosa create admin --cluster ${CLUSTER_NAME} --password ${CLUSTER_ADMIN_PASSWORD} >/dev/null
$(info cluster admin created)
.PHONY: rosa-cluster-admin-reset
rosa-cluster-admin-reset: ## Reset cluster admin password
$(call required-environment-variables,ROSA_TOKEN CLUSTER_NAME CLUSTER_ADMIN_PASSWORD)
@rosa delete admin --cluster ${CLUSTER_NAME} --yes >/dev/null
$(info cluster admin deleted)
@rosa create admin --cluster ${CLUSTER_NAME} --password ${CLUSTER_ADMIN_PASSWORD} >/dev/null
$(info cluster admin password reset)
.PHONY: rosa-cluster-oc-login
rosa-cluster-oc-login: ## OC cli login to existing cluster (cluster-admin should already exist)
$(call required-environment-variables,ROSA_TOKEN CLUSTER_NAME)
@rosa describe admin --cluster=${CLUSTER_NAME} | grep -v 'INFO'