-
Notifications
You must be signed in to change notification settings - Fork 0
/
walkthrough.sh
72 lines (54 loc) · 2.22 KB
/
walkthrough.sh
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
export AZURE_RESOURCE_GROUP=frankenetes
export ACI_REGION=eastus
export AZURE_STORAGE_ACCOUNT=frankenetes
az group create -n $AZURE_RESOURCE_GROUP -l $ACI_REGION
az storage account create -n $AZURE_STORAGE_ACCOUNT -g $AZURE_RESOURCE_GROUP
AZURE_STORAGE_KEY=$(az storage account keys list -n $AZURE_STORAGE_ACCOUNT -g $AZURE_RESOURCE_GROUP --query '[0].value' -o tsv)
# Create the file shares
az storage share create -n etcd
az storage share create -n apiserver
az storage share create -n auth
#Set up Service Principle to access ACI
az ad sp create-for-rbac --name virtual-kubernetes -o table
#Auth
# cert.pem
# key.pem
# credentials.json
# kubeconfig
# Generate the self sign certs and upload config to file share (cert.pem, key.pem)
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out cert.pem
az storage file upload \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--share-name "auth" \
--source "./cert.pem" \
--path "cert.pem"
az storage file upload \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--share-name "auth" \
--source "./key.pem" \
--path "key.pem"
# Upload the service principle credentials so that virtual kublet can create aci instances
az storage file upload \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--share-name "auth" \
--source "./credentials.json" \
--path "credentials.json"
# Upload the localhost kubeconfig so VK knows how to talk with the API server (kubeconfig)
az storage file upload \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $AZURE_STORAGE_KEY \
--share-name "auth" \
--source "./kubeconfig" \
--path "kubeconfig"
#TODO: Deploy the container group
# Set up cluster/context info in a standalone file
kubectl config set-cluster virtualk8s --server=http://$API_SERVER_IP:6445 --kubeconfig=virtualk8s.kubeconfig
kubectl config set-context default --cluster=virtualk8s --kubeconfig=virtualk8s.kubeconfig
kubectl config use-context default --kubeconfig=virtualk8s.kubeconfig
# Use the kubeconfig & cross your fingers!
export KUBECONFIG=virtualk8s.kubeconfig
kubectl version
kubectl api-versions