Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ endif

# this is configured to work with the capi-lab
export METAL_API_URL := "http://metal.203.0.113.1.nip.io:8080"
export METAL_API_HMAC := "metal-admin"
export METAL_API_HMAC := "metal-edit"
export METAL_API_HMAC_AUTH_TYPE := "Metal-Edit"

.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Now, you are able to install the CAPMS into your management cluster:
# export the following environment variables
export METAL_API_URL=<url>
export METAL_API_HMAC=<hmac>
export METAL_API_HMAC_AUTH_TYPE=<Metal-Admin or Metal-Edit>
export EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION=true

# initialize the management cluster
Expand Down
6 changes: 4 additions & 2 deletions capi-lab/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ KUBECONFIG := $(shell pwd)/mini-lab/.kubeconfig
MINI_LAB_FLAVOR=capms

METAL_API_URL=http://metal.203.0.113.1.nip.io:8080
METAL_API_HMAC=metal-admin
METAL_API_HMAC=metal-edit
METAL_API_HMAC_AUTH_TYPE=Metal-Edit
METALCTL_API_URL=http://metal.203.0.113.1.nip.io:8080
METALCTL_HMAC=metal-admin
METALCTL_HMAC=metal-edit
METALCTL_HMAC_AUTH_TYPE=Metal-Edit

METAL_PARTITION ?= mini-lab
METAL_PROJECT_ID ?= 00000000-0000-0000-0000-000000000001
Expand Down
8 changes: 7 additions & 1 deletion capi-lab/metal-ccm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
stringData:
api-url: ${METAL_API_URL}
api-hmac: ${METAL_API_HMAC}
api-hmac-auth-type: ${METAL_API_HMAC_AUTH_TYPE}
---
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -172,6 +173,11 @@ spec:
secretKeyRef:
key: api-hmac
name: cloud-controller-manager
- name: METAL_AUTH_HMAC_AUTH_TYPE
valueFrom:
secretKeyRef:
key: api-hmac-auth-type
name: cloud-controller-manager
- name: METAL_PROJECT_ID
value: 00000000-0000-0000-0000-000000000001
- name: METAL_PARTITION_ID
Expand All @@ -185,7 +191,7 @@ spec:
value: internet-mini-lab,${METAL_NODE_NETWORK_ID}
- name: METAL_SSH_PUBLICKEY
value: ""
image: ghcr.io/metal-stack/metal-ccm:v0.9.3
image: ghcr.io/metal-stack/metal-ccm:v0.9.4
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 2
Expand Down
7 changes: 6 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,10 @@ func newMetalClient() (metalgo.Client, error) {
return nil, errors.New("METAL_API_HMAC environment variable must be set")
}

return metalgo.NewDriver(url, "", hmac)
hmacAuthType := os.Getenv("METAL_API_HMAC_AUTH_TYPE")
if hmacAuthType == "" {
return nil, errors.New("METAL_API_HMAC_AUTH_TYPE environment variable must be set")
}

return metalgo.NewDriver(url, "", hmac, metalgo.AuthType(hmacAuthType))
}
6 changes: 6 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
stringData:
api-url: ${METAL_API_URL}
api-hmac: ${METAL_API_HMAC}
api-hmac-auth-type: ${METAL_API_HMAC_AUTH_TYPE}
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -44,6 +45,11 @@ spec:
secretKeyRef:
name: controller-manager-config
key: api-hmac
- name: METAL_API_HMAC_AUTH_TYPE
valueFrom:
secretKeyRef:
name: controller-manager-config
key: api-hmac-auth-type
command:
- /manager
args:
Expand Down
3 changes: 3 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# update this file only when a new major or minor version is released
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
releaseSeries:
- major: 0
minor: 3
contract: v1beta1
- major: 0
minor: 2
contract: v1beta1
Expand Down
Loading