Skip to content

Commit

Permalink
Rename Repository (#5)
Browse files Browse the repository at this point in the history
Ostensibly just sed baremetal to compute to reflect this as a more
general purpose compute service.
  • Loading branch information
spjmurray authored Oct 3, 2024
1 parent a949c0d commit 25e85b6
Show file tree
Hide file tree
Showing 54 changed files with 420 additions and 424 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ jobs:
- name: Touch
run: make touch
- name: Build Helm Chart
run: helm dependency update charts/baremetal
run: helm dependency update charts/compute
- name: Golang CI/Helm Lint
run: make lint
- name: Build Images
run: make charts/baremetal/crds images
run: make charts/compute/crds images
- name: Build Generated Code
run: make generate
- name: Generated Code Checked In
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/bin
/sboms
/charts/kubernetes/Chart.lock
/charts/kubernetes/charts
/charts/compute/Chart.lock
/charts/compute/charts
*.swp
cover.out
cover.html
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ REVISION := $(shell git rev-parse HEAD)
# for your host's architecture. The latter are going to run in Kubernetes, so
# want to be amd64.
CONTROLLERS = \
unikorn-baremetal-cluster-controller\
unikorn-baremetal-server \
unikorn-compute-cluster-controller\
unikorn-compute-server \

# Release will do cross compliation of all images for the 'all' target.
# Note we aren't fucking about with docker here because that opens up a
Expand All @@ -37,7 +37,7 @@ BINDIR = bin
CMDDIR = cmd
SRCDIR = src
GENDIR = generated
CRDDIR = charts/baremetal/crds
CRDDIR = charts/compute/crds

# Where to install things.
PREFIX = $(HOME)/bin
Expand Down Expand Up @@ -82,7 +82,7 @@ MOCKGEN_VERSION=v0.3.0

# This is the base directory to generate kubernetes API primitives from e.g.
# clients and CRDs.
GENAPIBASE = github.com/unikorn-cloud/baremetal/pkg/apis
GENAPIBASE = github.com/unikorn-cloud/compute/pkg/apis

# This is the list of APIs to generate clients for.
GENAPIS = $(GENAPIBASE)/unikorn/v1alpha1
Expand Down Expand Up @@ -187,7 +187,7 @@ touch:
lint: $(GENDIR)
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(LINT_VERSION)
$(GOBIN)/golangci-lint run --timeout=10m ./...
helm lint --strict charts/baremetal
helm lint --strict charts/compute

# Validate the server OpenAPI schema is legit.
.PHONY: validate
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Unikorn Baremetal Service
# Unikorn Compute Service

![Unikorn Logo](https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/light-on-dark/logo.svg#gh-dark-mode-only)
![Unikorn Logo](https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/logo.svg#gh-light-mode-only)

## Overview

The baremetal service is essentially a cut down version of the [Kubernetes service](https://github.com/unikorn-cloud/kubernetes) that provisions its own baremetal servers using hardware abstraction provided by the [Region service](https://github.com/unikorn-cloud/region).
The compute service is essentially a cut down version of the [Kubernetes service](https://github.com/unikorn-cloud/kubernetes) that provisions its own compute servers using hardware abstraction provided by the [Region service](https://github.com/unikorn-cloud/region).

Where possible, as the Baremetal service is very similar to the Kubernetes service, we must maintain type and API parity to ease creation of UX tools and services.
Where possible, as the Compute service is very similar to the Kubernetes service, we must maintain type and API parity to ease creation of UX tools and services.

## Installation

### Unikorn Prerequisites

To use the Baremetal service you first need to install:
To use the Compute service you first need to install:

* [The identity service](https://github.com/unikorn-cloud/identity) to provide API authentication and authorization.
* [The region service](https://github.com/unikorn-cloud/region) to provide provider agnostic cloud services (e.g. images, flavors and identity management).
Expand All @@ -22,15 +22,15 @@ To use the Baremetal service you first need to install:

#### Installing Prerequisites

The Unikorn baremetal server component has a couple prerequisites that are required for correct functionality.
The Unikorn compute server component has a couple prerequisites that are required for correct functionality.
If not installing the server component, skip to the next section.

You'll need to install:

* cert-manager (used to generate keying material for JWE/JWS and for ingress TLS)
* nginx-ingress (to perform routing, avoiding CORS, and TLS termination)

#### Installing the Baremetal Service
#### Installing the Compute Service

<details>
<summary>Helm</summary>
Expand All @@ -44,12 +44,12 @@ global:
host: https://identity.unikorn-cloud.org
region:
host: https://region.unikorn-cloud.org
baremetal:
host: https://baremetal.unikorn-cloud.org
compute:
host: https://compute.unikorn-cloud.org
```
```shell
helm install unikorn-baremetal charts/baremetal --namespace unikorn-baremetal --create-namespace --values values.yaml
helm install unikorn-compute charts/compute --namespace unikorn-compute --create-namespace --values values.yaml
```

</details>
Expand All @@ -61,13 +61,13 @@ helm install unikorn-baremetal charts/baremetal --namespace unikorn-baremetal --
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: unikorn-baremetal
name: unikorn-compute
namespace: argocd
spec:
project: default
source:
repoURL: https://unikorn-cloud.github.io/baremetal
chart: baremetal
repoURL: https://unikorn-cloud.github.io/compute
chart: compute
targetRevision: v0.1.0
destination:
namespace: unikorn
Expand All @@ -88,10 +88,10 @@ The [Unikorn Identity Service](https://github.com/unikorn-cloud/identity) descri
This service requires asynchronous access to the Unikorn Region API in order to poll cloud identity and physical network status during cluster creation, and delete those resources on cluster deletion.
This service defines the `unikorn-baremetal` user that will need to be added to a group in the service organization.
This service defines the `unikorn-compute` user that will need to be added to a group in the service organization.
It will need the built in role `infra-manager-service` that allows:

* Read access to the `region` endpoints to access external networks
* Read/delete access to the `identites` endpoints to poll and delete cloud identities
* Read/delete access to the `physicalnetworks` endpoints to poll and delete physical networks
* Create/Read/Delete access to the `servers` endpoints to manage baremetal instances
* Create/Read/Delete access to the `servers` endpoints to manage compute instances
6 changes: 0 additions & 6 deletions charts/baremetal/Chart.lock

This file was deleted.

Binary file removed charts/baremetal/charts/unikorn-common-v0.1.9.tgz
Binary file not shown.
22 changes: 0 additions & 22 deletions charts/baremetal/templates/_helpers.tpl

This file was deleted.

6 changes: 3 additions & 3 deletions charts/baremetal/Chart.yaml → charts/compute/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: unikorn-baremetal
description: A Helm chart for deploying Unikorn baremetal Service
name: unikorn-compute
description: A Helm chart for deploying Unikorn compute Service

type: application

Expand All @@ -11,5 +11,5 @@ icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/d

dependencies:
- name: unikorn-common
version: v0.1.9
version: v0.1.13
repository: https://unikorn-cloud.github.io/helm-common
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
name: baremetalclusters.baremetal.unikorn-cloud.org
controller-gen.kubebuilder.io/version: v0.16.3
name: computeclusters.compute.unikorn-cloud.org
spec:
group: baremetal.unikorn-cloud.org
group: compute.unikorn-cloud.org
names:
categories:
- unikorn
kind: BaremetalCluster
listKind: BaremetalClusterList
plural: baremetalclusters
singular: baremetalcluster
kind: ComputeCluster
listKind: ComputeClusterList
plural: computeclusters
singular: computecluster
scope: Namespaced
versions:
- additionalPrinterColumns:
Expand All @@ -30,7 +30,7 @@ spec:
schema:
openAPIV3Schema:
description: |-
BaremetalCluster is an object representing a Baremetal cluster.
ComputeCluster is an object representing a Compute cluster.
For now, this is a monolith for simplicity. In future it may reference
a provider specific implementation e.g. if CAPI goes out of favour for
some other new starlet.
Expand All @@ -53,25 +53,25 @@ spec:
metadata:
type: object
spec:
description: BaremetalClusterSpec defines the requested state of the Baremetal
description: ComputeClusterSpec defines the requested state of the Compute
cluster.
properties:
network:
description: Network defines the Baremetal networking.
description: Network defines the Compute networking.
properties:
dnsNameservers:
description: |-
DNSNameservers sets the DNS nameservers for pods.
At present due to some technical challenges, this must contain
only one DNS server.
description: DNSNameservers sets the DNS nameservers for hosts
on the network.
items:
pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$
type: string
minItems: 1
type: array
x-kubernetes-list-type: set
nodeNetwork:
description: NodeNetwork is the IPv4 prefix for the node network.
description: |-
NodeNetwork is the IPv4 prefix for the node network.
This is tyically used to populate a physical network address range.
pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\/(?:3[0-2]|[1-2]?[0-9])$
type: string
required:
Expand All @@ -94,17 +94,22 @@ spec:
generated clusters.
items:
properties:
diskSize:
anyOf:
- type: integer
- type: string
description: |-
DiskSize is the persistent root disk size to deploy with. This
overrides the default ephemeral disk size defined in the flavor.
This is irrelevant for baremetal machine flavors.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
flavorId:
description: Flavor is the OpenStack Nova flavor to deploy
description: Flavor is the regions service flavor to deploy
with.
type: string
flavorName:
description: |-
FlavorName is the name of the flavor.
CAPO is broken and doesn't accept an ID, so we need to use this.
type: string
imageId:
description: Image is the OpenStack Glance image to deploy
description: Image is the region service image to deploy
with.
type: string
name:
Expand All @@ -117,7 +122,6 @@ spec:
type: integer
required:
- flavorId
- flavorName
- imageId
- name
type: object
Expand All @@ -129,11 +133,11 @@ spec:
- workloadPools
type: object
status:
description: BaremetalClusterStatus defines the observed state of the
Baremetal cluster.
description: ComputeClusterStatus defines the observed state of the Compute
cluster.
properties:
conditions:
description: Current service state of a Baremetal cluster.
description: Current service state of a Compute cluster.
items:
description: |-
Condition is a generic condition type for use across all resource types.
Expand Down
22 changes: 22 additions & 0 deletions charts/compute/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{/*
Create the container images
*/}}
{{- define "unikorn.computeClusterControllerImage" -}}
{{- .Values.clusterController.image | default (printf "%s/unikorn-compute-cluster-controller:%s" (include "unikorn.defaultRepositoryPath" .) (.Values.tag | default .Chart.Version)) }}
{{- end }}

{{- define "unikorn.computeServerImage" -}}
{{- .Values.server.image | default (printf "%s/unikorn-compute-server:%s" (include "unikorn.defaultRepositoryPath" .) (.Values.tag | default .Chart.Version)) }}
{{- end }}

{{/*
Create image pull secrets
*/}}
{{- define "unikorn.imagePullSecrets" -}}
{{- if .Values.imagePullSecret -}}
- name: {{ .Values.imagePullSecret }}
{{ end }}
{{- if .Values.dockerConfig -}}
- name: docker-config
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: unikorn-baremetal-client
name: unikorn-compute-client
labels:
{{- include "unikorn.labels" . | nindent 4 }}
spec:
Expand All @@ -13,5 +13,5 @@ spec:
algorithm: RSA
encoding: PKCS8
size: 4096
secretName: unikorn-baremetal-client-certificate
commonName: unikorn-baremetal
secretName: unikorn-compute-client-certificate
commonName: unikorn-compute
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: unikorn-baremetal-cluster-controller
name: unikorn-compute-cluster-controller
labels:
{{- include "unikorn.labels" . | nindent 4 }}
rules:
# Manage baremetal clusters (my job).
# Manage compute clusters (my job).
- apiGroups:
- unikorn-cloud.org
- compute.unikorn-cloud.org
resources:
- baremetalclusters
- computeclusters
verbs:
- list
- get
- patch
- watch
- update
- apiGroups:
- unikorn-cloud.org
- compute.unikorn-cloud.org
resources:
- baremetalclusters/status
- computeclusters/status
verbs:
- update
- apiGroups:
Expand Down
Loading

0 comments on commit 25e85b6

Please sign in to comment.