-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
171 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: test-app | ||
labels: | ||
app.kubernetes.io/name: test-app | ||
app.kubernetes.io/part-of: test-app-project | ||
kubernetes.azure.com/generator: draft | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: test-app | ||
minReplicas: 2 | ||
maxReplicas: 5 | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: test-app | ||
labels: | ||
app.kubernetes.io/name: test-app | ||
app.kubernetes.io/part-of: test-app-project | ||
kubernetes.azure.com/generator: draft | ||
spec: | ||
maxUnavailable: 1 | ||
selector: | ||
matchLabels: | ||
app: test-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: test-app | ||
labels: | ||
app.kubernetes.io/name: test-app | ||
app.kubernetes.io/part-of: test-app-project | ||
kubernetes.azure.com/generator: draft | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: test-app | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
...izontalPodAutoscaling/manifest/draft.yaml → ...izontalPodAutoscaler/manifests/draft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,51 @@ | ||
templateName: "horizontalPodAutoscaling-manifest" | ||
templateName: "horizontalPodAutoscaler-manifests" | ||
description: "This template is used to create a horizontalPodAutoscaling for an application" | ||
versions: "0.0.1" | ||
defaultVersion: "0.0.1" | ||
type: "manifest" | ||
variables: | ||
- name: "APPNAME" | ||
type: "string" | ||
kind: "kubernetesResourceName" | ||
description: "the name of the application" | ||
versions: ">=0.0.1" | ||
- name: "PARTOF" | ||
type: "string" | ||
kind: "label" | ||
description: "the label to identify which project the resource belong to" | ||
versions: ">=0.0.1" | ||
- name: "GENERATORLABEL" | ||
type: "string" | ||
kind: "label" | ||
description: "the label to identify who generated the resource" | ||
versions: ">=0.0.1" | ||
default: | ||
value: "draft" | ||
- name: "MINIMUMREPLICAS" | ||
type: "int" | ||
kind: "replicaCount" | ||
description: "specifies the minimum number of pod replicas that the deployment should have" | ||
versions: ">=0.0.1" | ||
default: | ||
value: 2 | ||
- name: "MAXIMUMREPLICAS" | ||
type: "int" | ||
kind: "replicaCount" | ||
description: "defines the maximum number of pod replicas the deployment can scale to" | ||
versions: ">=0.0.1" | ||
default: | ||
value: 5 | ||
- name: "RESOURCETYPE" | ||
type: "string" | ||
kind: "scalingResourceType" | ||
description: "specifies the resource type (e.g., cpu or memory) to be monitored for scaling" | ||
versions: ">=0.0.1" | ||
default: | ||
value: "cpu" | ||
- name: "AVGUTILIZATION" | ||
type: "int" | ||
kind: "scalingResourceUtilization" | ||
description: "specifies the average utilization for the monitored resource, triggering scaling when exceeded" | ||
versions: ">=0.0.1" | ||
default: | ||
value: 80 |
22 changes: 22 additions & 0 deletions
22
template/manifests/HorizontalPodAutoscaler/manifests/hpa.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ .Config.GetVariableValue "APPNAME" }} | ||
labels: | ||
app.kubernetes.io/name: {{ .Config.GetVariableValue "APPNAME" }} | ||
app.kubernetes.io/part-of: {{ .Config.GetVariableValue "PARTOF" }} | ||
kubernetes.azure.com/generator: {{ .Config.GetVariableValue "GENERATORLABEL" }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ .Config.GetVariableValue "APPNAME" }} | ||
minReplicas: {{ .Config.GetVariableValue "MINIMUMREPLICAS" }} | ||
maxReplicas: {{ .Config.GetVariableValue "MAXIMUMREPLICAS" }} | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: {{ .Config.GetVariableValue "RESOURCETYPE" }} | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ .Config.GetVariableValue "AVGUTILIZATION"}} |
22 changes: 0 additions & 22 deletions
22
template/manifests/HorizontalPodAutoscaling/manifest/hpa.yaml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
8 changes: 7 additions & 1 deletion
8
...s/PodDisruptionBudget/manifest/draft.yaml → .../PodDisruptionBudget/manifests/draft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
templateName: "podDisruptionBudget-manifest" | ||
templateName: "podDisruptionBudget-manifests" | ||
description: "This template is used to create a PodDisruptionBudget for an application" | ||
versions: "0.0.1" | ||
defaultVersions: "0.0.1" | ||
type: "manifest" | ||
variables: | ||
- name: "APPNAME" | ||
type: "string" | ||
kind: "kubernetesResourceName" | ||
description: "the name of the application" | ||
versions: ">=0.0.1" | ||
- name: "PARTOF" | ||
type: "string" | ||
kind: "label" | ||
description: "the label to identify which project the resource belong to" | ||
versions: ">=0.0.1" | ||
- name: "GENERATORLABEL" | ||
type: "string" | ||
kind: "label" | ||
description: "the label to identify who generated the resource" | ||
versions: ">=0.0.1" | ||
default: | ||
value: "draft" | ||
- name: "MAXUNAVAILABLE" | ||
type: "int" | ||
kind: "resourceLimit" | ||
description: "specifies the maximum number of pods that can be unavailable during a disruption, such as a pod eviction" | ||
versions: ">=0.0.1" | ||
default: | ||
value: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: {{.Config.GetVariableValue "APPNAME" }} | ||
labels: | ||
app.kubernetes.io/name: {{ .Config.GetVariableValue "APPNAME"}} | ||
app.kubernetes.io/part-of: {{ .Config.GetVariableValue "PARTOF" }} | ||
kubernetes.azure.com/generator: {{ .Config.GetVariableValue "GENERATORLABEL"}} | ||
spec: | ||
maxUnavailable: {{ .Config.GetVariableValue "MAXUNAVAILABLE" }} | ||
selector: | ||
matchLabels: | ||
app: {{ .Config.GetVariableValue "APPNAME" }} |
9 changes: 8 additions & 1 deletion
9
template/manifests/Service/draft.yaml → ...te/manifests/Service/manifests/draft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
templateName: "Service" | ||
templateName: "service-manifests" | ||
description: "This template is used to create a generic Service for an application" | ||
versions: "0.0.1" | ||
defaultVersion: "0.0.1" | ||
type: "manifest" | ||
variables: | ||
- name: "PORT" | ||
type: "int" | ||
kind: "port" | ||
description: "the port the service uses to make the application accessible from outside the cluster" | ||
versions: ">=0.0.1" | ||
default: | ||
value: 80 | ||
- name: "APPNAME" | ||
type: "string" | ||
kind: "kubernetesResourceName" | ||
description: "the name of the application" | ||
versions: ">=0.0.1" | ||
- name: "PARTOF" | ||
type: "string" | ||
kind: "label" | ||
description: "the label to identify which project the resource belong to" | ||
versions: ">=0.0.1" | ||
- name: "GENERATORLABEL" | ||
type: "string" | ||
kind: "label" | ||
description: "the label to identify who generated the resource" | ||
versions: ">=0.0.1" | ||
default: | ||
value: "draft" | ||
- name: "TARGETPORT" | ||
type: "int" | ||
kind: "port" | ||
description: "the port exposed in the application" | ||
versions: ">=0.0.1" | ||
default: | ||
referenceVar: "PORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Config.GetVariableValue "APPNAME" }} | ||
labels: | ||
app.kubernetes.io/name: {{ .Config.GetVariableValue "APPNAME" }} | ||
app.kubernetes.io/part-of: {{ .Config.GetVariableValue "PARTOF" }} | ||
kubernetes.azure.com/generator: {{ .Config.GetVariableValue "GENERATORLABEL" }} | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: {{ .Config.GetVariableValue "APPNAME" }} | ||
ports: | ||
- protocol: TCP | ||
port: {{ .Config.GetVariableValue "PORT" }} | ||
targetPort: {{ .Config.GetVariableValue "TARGETPORT" }} |
This file was deleted.
Oops, something went wrong.