Skip to content

Commit

Permalink
fix!: shorten overly long name for HMSS Mill Deployment
Browse files Browse the repository at this point in the history
The name is too long for the standard metadata name field.

BREAKING CHANGE: Renames a K8s Deployment in the dev configuration.
  • Loading branch information
SanjayVas committed Jul 16, 2024
1 parent 9b9a87b commit 9d36901
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/configure-aws-duchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ permissions:

env:
KUSTOMIZATION_PATH: "k8s/cmms"
KUBECTL_APPLYSET: true
DUCHY_NAME: ${{ inputs.duchy-name }}

jobs:
Expand Down Expand Up @@ -174,7 +175,7 @@ jobs:

- name: kubectl apply
if: ${{ inputs.apply }}
run: kubectl apply -k "$KUSTOMIZE_PATH"
run: kubectl apply -k "$KUSTOMIZE_PATH" --namespace=default --prune --applyset=configmaps/kubectl

- name: Wait for rollout
if: ${{ inputs.apply }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/configure-duchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ permissions:

env:
KUSTOMIZATION_PATH: "k8s/cmms"
KUBECTL_APPLYSET: true
DUCHY_NAME: ${{ inputs.duchy-name }}

jobs:
Expand Down Expand Up @@ -176,7 +177,7 @@ jobs:

- name: kubectl apply
if: ${{ inputs.apply }}
run: kubectl apply -k "$KUSTOMIZE_PATH"
run: kubectl apply -k "$KUSTOMIZE_PATH" --namespace=default --prune --applyset=configmaps/kubectl

- name: Wait for rollout
if: ${{ inputs.apply }}
Expand Down
37 changes: 18 additions & 19 deletions src/main/k8s/base.cue
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ objects: [ for objectSet in objectSets for object in objectSet {object}]
// K8s LabelSelector.
#LabelSelector: {
matchExpressions?: [...#LabelSelectorRequirement]
matchLabels: [string]: string
matchLabels?: [string]: string
}

// K8s ConfigMap.
Expand Down Expand Up @@ -570,22 +570,24 @@ objects: [ for objectSet in objectSets for object in objectSet {object}]
}
}

// K8s NetworkPolicyPort.
#NetworkPolicyPort: {
port?: #PortNumber
protocol?: #IpProtocol
}

// K8s NetworkPolicyEgressRule.
#EgressRule: {
to: [...]
ports: [...#NetworkPolicyPort]
#NetworkPolicyEgressRule: {
to?: [...#NetworkPolicyPeer]
ports?: [...#NetworkPolicyPort]
}

// K8s NetworkPolicyIngressRule.
#IngressRule: {
from: [...]
ports: [...#NetworkPolicyPort]
#NetworkPolicyIngressRule: {
from?: [...#NetworkPolicyPeer]
ports?: [...#NetworkPolicyPort]
}

// K8s NetworkPolicyPeer.
#NetworkPolicyPeer: {
ipBlock?: {...}
namespaceSelector?: #LabelSelector
podSelector?: #LabelSelector
ports?: [...#NetworkPolicyPort]
}

// K8s NetworkPolicy.
Expand All @@ -599,8 +601,8 @@ objects: [ for objectSet in objectSets for object in objectSet {object}]
_app_label?: string
_sourceMatchLabels: [...string]
_destinationMatchLabels: [...string]
_ingresses: [Name=_]: #IngressRule
_egresses: [Name=_]: #EgressRule
_ingresses: [_]: #NetworkPolicyIngressRule
_egresses: [_]: #NetworkPolicyEgressRule

_ingresses: {
if len(_sourceMatchLabels) > 0 {
Expand Down Expand Up @@ -640,11 +642,8 @@ objects: [ for objectSet in objectSets for object in objectSet {object}]

apiVersion: "networking.k8s.io/v1"
kind: "NetworkPolicy"
metadata: {
metadata: #ObjectMeta & {
name: _name + "-network-policy"
labels: {
"app.kubernetes.io/part-of": #AppName
}
}
spec: {
podSelector: #LabelSelector & {
Expand Down
16 changes: 8 additions & 8 deletions src/main/k8s/dev/duchy_eks.cue
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ objectSets: [

duchy: #PostgresDuchy & {
_imageSuffixes: {
"herald-daemon": "duchy/aws-herald"
"computation-control-server": "duchy/aws-computation-control"
"liquid-legions-v2-mill-daemon": "duchy/aws-liquid-legions-v2-mill"
"honest-majority-share-shuffle-mill-daemon": "duchy/aws-honest-majority-share-shuffle-mill"
"requisition-fulfillment-server": "duchy/aws-requisition-fulfillment"
"internal-api-server": "duchy/aws-postgres-internal-server"
"update-duchy-schema": "duchy/aws-postgres-update-schema"
"herald-daemon": "duchy/aws-herald"
"computation-control-server": "duchy/aws-computation-control"
"liquid-legions-v2-mill-daemon": "duchy/aws-liquid-legions-v2-mill"
"hmss-mill-daemon": "duchy/aws-honest-majority-share-shuffle-mill"
"requisition-fulfillment-server": "duchy/aws-requisition-fulfillment"
"internal-api-server": "duchy/aws-postgres-internal-server"
"update-duchy-schema": "duchy/aws-postgres-update-schema"
}
_duchy: {
name: _duchyName
Expand Down Expand Up @@ -151,7 +151,7 @@ duchy: #PostgresDuchy & {
}
}
}
"honest-majority-share-shuffle-mill-daemon-deployment": {
"hmss-mill-daemon-deployment": {
_workLockDuration: "5m"
_container: {
_javaOptions: maxHeapSize: #HmssMillMaxHeapSize
Expand Down
2 changes: 1 addition & 1 deletion src/main/k8s/dev/duchy_gke.cue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ duchy: #SpannerDuchy & {
}
}
}
"honest-majority-share-shuffle-mill-daemon-deployment": {
"hmss-mill-daemon-deployment": {
_workLockDuration: "5m"
_container: {
_javaOptions: maxHeapSize: #HmssMillMaxHeapSize
Expand Down
22 changes: 11 additions & 11 deletions src/main/k8s/duchy.cue
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ import ("strings")

_imageSuffixes: [string]: string
_imageSuffixes: {
"async-computation-control-server": string | *"duchy/async-computation-control"
"computation-control-server": string | *"duchy/computation-control"
"herald-daemon": string | *"duchy/herald"
"liquid-legions-v2-mill-daemon": string | *"duchy/liquid-legions-v2-mill"
"honest-majority-share-shuffle-mill-daemon": string | *"duchy/honest-majority-share-shuffle-mill"
"requisition-fulfillment-server": string | *"duchy/requisition-fulfillment"
"computations-cleaner": string | *"duchy/computations-cleaner"
"async-computation-control-server": string | *"duchy/async-computation-control"
"computation-control-server": string | *"duchy/computation-control"
"herald-daemon": string | *"duchy/herald"
"liquid-legions-v2-mill-daemon": string | *"duchy/liquid-legions-v2-mill"
"hmss-mill-daemon": string | *"duchy/honest-majority-share-shuffle-mill"
"requisition-fulfillment-server": string | *"duchy/requisition-fulfillment"
"computations-cleaner": string | *"duchy/computations-cleaner"
}
_imageConfigs: [string]: #ImageConfig
_imageConfigs: {
Expand Down Expand Up @@ -161,7 +161,7 @@ import ("strings")
"\(_name)-internal-api-server", "\(_name)-computation-control-server",
]
}
"honest-majority-share-shuffle-mill-daemon-deployment": {
"hmss-mill-daemon-deployment": {
_workLockDuration?: string
_container: args: [
_duchyInternalApiTargetFlag,
Expand Down Expand Up @@ -298,7 +298,7 @@ import ("strings")
_sourceMatchLabels: [
_object_prefix + "herald-daemon-app",
_object_prefix + "liquid-legions-v2-mill-daemon-app",
_object_prefix + "honest-majority-share-shuffle-mill-daemon-app",
_object_prefix + "hmss-mill-daemon-app",
_object_prefix + "async-computation-control-server-app",
_object_prefix + "requisition-fulfillment-server-app",
_object_prefix + "computations-cleaner-app",
Expand Down Expand Up @@ -355,8 +355,8 @@ import ("strings")
any: {}
}
}
"honest-majority-share-shuffle-mill-daemon": {
_app_label: _object_prefix + "honest-majority-share-shuffle-mill-daemon-app"
"hmss-mill-daemon": {
_app_label: _object_prefix + "hmss-mill-daemon-app"
_egresses: {
// Need to send external traffic.
any: {}
Expand Down
10 changes: 5 additions & 5 deletions src/main/k8s/local/duchies.cue
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ _computationControlTargets: {

_baseDuchyConfig: {
_imageSuffixes: {
"computation-control-server": "duchy/local-computation-control"
"herald-daemon": "duchy/local-herald"
"liquid-legions-v2-mill-daemon": "duchy/local-liquid-legions-v2-mill"
"honest-majority-share-shuffle-mill-daemon": "duchy/local-honest-majority-share-shuffle-mill"
"requisition-fulfillment-server": "duchy/local-requisition-fulfillment"
"computation-control-server": "duchy/local-computation-control"
"herald-daemon": "duchy/local-herald"
"liquid-legions-v2-mill-daemon": "duchy/local-liquid-legions-v2-mill"
"hmss-mill-daemon": "duchy/local-honest-majority-share-shuffle-mill"
"requisition-fulfillment-server": "duchy/local-requisition-fulfillment"
}
_duchy_secret_name: _secret_name
_computation_control_targets: _computationControlTargets
Expand Down

0 comments on commit 9d36901

Please sign in to comment.