diff --git a/README.md b/README.md index 9c2050c..427f035 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ # Harness Docs Repo This repo (`harness-docs`) contains examples for Harness quickstarts and other documentation. +#testasasasassasaasasasaassasaasaasasas ## Links diff --git a/creds.yaml b/creds.yaml new file mode 100644 index 0000000..89d18ae --- /dev/null +++ b/creds.yaml @@ -0,0 +1,3 @@ +creds: + username: <+secrets.getValue("secret_id_1")> + password: <+secrets.getValue("secret_id_1")> diff --git a/default-k8s-manifests/Manifests/Files/ng_values_dockercfg.yaml b/default-k8s-manifests/Manifests/Files/ng_values_dockercfg.yaml index e0a7cc2..9c17a45 100644 --- a/default-k8s-manifests/Manifests/Files/ng_values_dockercfg.yaml +++ b/default-k8s-manifests/Manifests/Files/ng_values_dockercfg.yaml @@ -1,12 +1,13 @@ name: harness-quickstart replicas: 1 -image: <+artifact.image> -dockercfg: <+artifact.imagePullSecret> +image: <+artifact.image> +dockercfg: <+artifact.imagePullSecret1> createNamespace: true namespace: <+infra.namespace> +myjsonval: <+configFile.getAsBase64('myjson')> # Service Type allow you to specify what kind of service you want. # Possible values for ServiceType are: # ClusterIP | NodePort | LoadBalancer | ExternalName @@ -23,6 +24,6 @@ serviceTargetPort: 80 # Both are added to the container environment in podSpec as envFrom source. env: config: - key1: value1 + key1: <+serviceVariables.dynamic_name_2> secrets: - key2: value2 + key2: <+serviceVariables.dynamic_name_3> diff --git a/default-k8s-manifests/Manifests/Files/templates/deployment.yaml b/default-k8s-manifests/Manifests/Files/templates/deployment.yaml index 8cde0ed..31100a3 100644 --- a/default-k8s-manifests/Manifests/Files/templates/deployment.yaml +++ b/default-k8s-manifests/Manifests/Files/templates/deployment.yaml @@ -44,6 +44,8 @@ spec: metadata: labels: app: {{.Values.name}} + annotations: + json: {{.Values.myjsonval | quote }} spec: {{- if .Values.dockercfg}} imagePullSecrets: @@ -62,4 +64,4 @@ spec: - secretRef: name: {{.Values.name}} {{- end}} - {{- end}} \ No newline at end of file + {{- end}} diff --git a/default-k8s-manifests/Manifests/deployment.yaml b/default-k8s-manifests/Manifests/deployment.yaml index a748d1b..0f9260c 100644 --- a/default-k8s-manifests/Manifests/deployment.yaml +++ b/default-k8s-manifests/Manifests/deployment.yaml @@ -1,3 +1,4 @@ +#asrtsaxssaa apiVersion: apps/v1 kind: Deployment metadata: diff --git a/kustomize/helloWorld/appsettings.json b/kustomize/helloWorld/appsettings.json new file mode 100644 index 0000000..00ea3a0 --- /dev/null +++ b/kustomize/helloWorld/appsettings.json @@ -0,0 +1,4 @@ +{ + "altGreeting": "Good Morning!", + "enableRisky": "<+secrets.getValue("secret_id_1")>" +} diff --git a/kustomize/helloWorld/configMap.yaml b/kustomize/helloWorld/configMap.yaml deleted file mode 100644 index e335ab8..0000000 --- a/kustomize/helloWorld/configMap.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: the-map -data: - altGreeting: "Good Morning!" - enableRisky: "false" diff --git a/kustomize/helloWorld/deployment.yaml b/kustomize/helloWorld/deployment.yaml index 00e5eb9..e9e9a0b 100644 --- a/kustomize/helloWorld/deployment.yaml +++ b/kustomize/helloWorld/deployment.yaml @@ -14,7 +14,6 @@ spec: spec: containers: - name: the-container - image: monopole/hello:1 command: ["/hello", "--port=8080", "--enableRiskyFeature=$(ENABLE_RISKY)"] @@ -24,10 +23,10 @@ spec: - name: ALT_GREETING valueFrom: configMapKeyRef: - name: the-map + name: app-config key: altGreeting - name: ENABLE_RISKY valueFrom: configMapKeyRef: - name: the-map + name: app-config key: enableRisky diff --git a/kustomize/helloWorld/kustomization.yaml b/kustomize/helloWorld/kustomization.yaml index 8e68559..c7ce69c 100644 --- a/kustomize/helloWorld/kustomization.yaml +++ b/kustomize/helloWorld/kustomization.yaml @@ -1,14 +1,20 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -# metadata: -# name: arbitrary -# Example configuration for the webserver -# at https://github.com/monopole/hello commonLabels: app: hello resources: -- deployment.yaml -- service.yaml -- configMap.yaml + - deployment.yaml + - service.yaml + +patchesStrategicMerge: + - patches/deploymentpatch.yaml + +configMapGenerator: + - name: app-config + files: + - appsettings.json + +generatorOptions: + disableNameSuffixHash: true diff --git a/kustomize/helloWorld/patches/deploymentpatch.yaml b/kustomize/helloWorld/patches/deploymentpatch.yaml new file mode 100644 index 0000000..d403b87 --- /dev/null +++ b/kustomize/helloWorld/patches/deploymentpatch.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: the-deployment +spec: + template: + spec: + containers: + - name: the-container + image: <+artifacts.primary.image>