← azuredeploy

change harness directory name

615fd8416e3f94661b6c8d9abddf678307a18be0 · ovidiucs · Jun 24, 2024 17:22

+120 · 5 files changed

  • .harness/pipeline/container_pipeline.yml +58 −0
  • .harness/services/primary_container_deployment.yaml +21 −0
  • .harness/services/primary_service.yaml +10 −0
  • .harness/services/secondary_container_deployment.yaml +21 −0
  • .harness/services/secondary_service.yaml +10 −0
diff --git a/.harness/pipeline/container_pipeline.yml b/.harness/pipeline/container_pipeline.yml
new file mode 100644
index 0000000..135a672
--- /dev/null
+++ b/.harness/pipeline/container_pipeline.yml
@@ -0,0 +1,58 @@
+pipeline:
+  name: container_pipeline
+  identifier: container_rolling_pipeline
+  projectIdentifier: default_project
+  orgIdentifier: default
+  tags: {}
+  stages:
+    - stage:
+        name: deploy-container
+        identifier: deploycontainer
+        description: ""
+        type: Deployment
+        spec:
+          deploymentType: Kubernetes
+          service:
+            serviceRef: harness_deploy_container
+            serviceInputs:
+              serviceDefinition:
+                type: Kubernetes
+                spec:
+                  artifacts:
+                    primary:
+                      type: Acr
+                      spec:
+                        tag: <+input>
+          environment:
+            environmentRef: test
+            deployToAll: false
+            infrastructureDefinitions:
+              - identifier: harness_k8sinfra
+          execution:
+            steps:
+              - step:
+                  name: Rollout Deployment
+                  identifier: rolloutDeployment
+                  type: K8sRollingDeploy
+                  timeout: 10m
+                  spec:
+                    skipDryRun: false
+                    pruningEnabled: false
+                    delegateSelectors:
+                      - kubernetes-delegate
+            rollbackSteps:
+              - step:
+                  name: Rollback Rollout Deployment
+                  identifier: rollbackRolloutDeployment
+                  type: K8sRollingRollback
+                  timeout: 10m
+                  spec:
+                    pruningEnabled: false
+        tags: {}
+        failureStrategies:
+          - onFailure:
+              errors:
+                - AllErrors
+              action:
+                type: StageRollback
+
diff --git a/.harness/services/primary_container_deployment.yaml b/.harness/services/primary_container_deployment.yaml
new file mode 100644
index 0000000..e6fd6ba
--- /dev/null
+++ b/.harness/services/primary_container_deployment.yaml
@@ -0,0 +1,21 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: primary-container
+spec:
+  replicas: 1
+  revisionHistoryLimit: 3
+  selector:
+    matchLabels:
+      app: primary-container
+  template:
+    metadata:
+      labels:
+        app: primary-container
+    spec:
+      containers:
+        - image: azacrkub.azurecr.io/primary_container:latest
+          name: primary-container
+          ports:
+          - containerPort: 12345
+
diff --git a/.harness/services/primary_service.yaml b/.harness/services/primary_service.yaml
new file mode 100644
index 0000000..00fd1af
--- /dev/null
+++ b/.harness/services/primary_service.yaml
@@ -0,0 +1,10 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: primary-container
+spec:
+  ports:
+  - port: 80
+    targetPort: 12345
+  selector:
+    app: primary-container    
diff --git a/.harness/services/secondary_container_deployment.yaml b/.harness/services/secondary_container_deployment.yaml
new file mode 100644
index 0000000..003900d
--- /dev/null
+++ b/.harness/services/secondary_container_deployment.yaml
@@ -0,0 +1,21 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: secondary-container
+spec:
+  replicas: 1
+  revisionHistoryLimit: 3
+  selector:
+    matchLabels:
+      app: secondary-container
+  template:
+    metadata:
+      labels:
+        app: secondary-container
+    spec:
+      containers:
+      - image: azacrkub.azurecr.io/secondary_container:latest
+        name: secondary-container
+        ports:
+        - containerPort: 23456
+
diff --git a/.harness/services/secondary_service.yaml b/.harness/services/secondary_service.yaml
new file mode 100644
index 0000000..1c5e2e6
--- /dev/null
+++ b/.harness/services/secondary_service.yaml
@@ -0,0 +1,10 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: secondary-container
+spec:
+  ports:
+  - port: 80
+    targetPort: 12345
+  selector:
+    app: secondary-container