Configure external-dns to create docker sub domain rcords and https listener
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								nexus-repository-manager/.DS_Store
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								nexus-repository-manager/.DS_Store
									
									
									
									
										vendored
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										66
									
								
								nxrm-aws-resiliency/templates/external-dns-rbac.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								nxrm-aws-resiliency/templates/external-dns-rbac.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,66 @@ | ||||
| # comment out sa if it was previously created | ||||
| apiVersion: rbac.authorization.k8s.io/v1 | ||||
| kind: ClusterRole | ||||
| metadata: | ||||
|   name: external-dns | ||||
|   namespace: {{ .Values.namespaces.externaldnsNs }} | ||||
|   labels: | ||||
|     app.kubernetes.io/name: external-dns | ||||
| rules: | ||||
|   - apiGroups: [""] | ||||
|     resources: ["services","endpoints","pods","nodes"] | ||||
|     verbs: ["get","watch","list"] | ||||
|   - apiGroups: ["extensions","networking.k8s.io"] | ||||
|     resources: ["ingresses"] | ||||
|     verbs: ["get","watch","list"] | ||||
| --- | ||||
| apiVersion: rbac.authorization.k8s.io/v1 | ||||
| kind: ClusterRoleBinding | ||||
| metadata: | ||||
|   name: external-dns-viewer | ||||
|   namespace: {{ .Values.namespaces.externaldnsNs }}   | ||||
|   labels: | ||||
|     app.kubernetes.io/name: external-dns | ||||
| roleRef: | ||||
|   apiGroup: rbac.authorization.k8s.io | ||||
|   kind: ClusterRole | ||||
|   name: external-dns | ||||
| subjects: | ||||
|   - kind: ServiceAccount | ||||
|     name: {{ .Values.serviceAccount.externaldns.name }} | ||||
|     namespace: {{ .Values.namespaces.externaldnsNs }} | ||||
| --- | ||||
| apiVersion: apps/v1 | ||||
| kind: Deployment | ||||
| metadata: | ||||
|   name: external-dns | ||||
|   namespace: {{ .Values.namespaces.externaldnsNs }}   | ||||
|   labels: | ||||
|     app.kubernetes.io/name: external-dns | ||||
| spec: | ||||
|   strategy: | ||||
|     type: Recreate | ||||
|   selector: | ||||
|     matchLabels: | ||||
|       app.kubernetes.io/name: external-dns | ||||
|   template: | ||||
|     metadata: | ||||
|       labels: | ||||
|         app.kubernetes.io/name: external-dns | ||||
|     spec: | ||||
|       serviceAccountName: external-dns | ||||
|       containers: | ||||
|         - name: external-dns | ||||
|           image: k8s.gcr.io/external-dns/external-dns:v0.11.0 | ||||
|           args: | ||||
|             - --source=service | ||||
|             - --source=ingress | ||||
|             - --domain-filter={{ .Values.externaldns.domainFilter }} # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones | ||||
|             - --provider=aws | ||||
|             - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization | ||||
|             - --aws-zone-type=public # only look at public hosted zones (valid values are public, private or no value for both) | ||||
|             - --registry=txt | ||||
|             - --txt-owner-id=external-dns | ||||
|           env: | ||||
|             - name: AWS_DEFAULT_REGION | ||||
|               value: {{ .Values.deployment.clusterRegion }} | ||||
| @@ -263,7 +263,7 @@ spec: | ||||
|     spec: | ||||
|       containers: | ||||
|         - name: fluent-bit | ||||
|           image: amazon/aws-for-fluent-bit:2.10.0 | ||||
|           image: amazon/aws-for-fluent-bit:{{ .Values.deployment.fluentBitVersion }} | ||||
|           imagePullPolicy: Always | ||||
|           env: | ||||
|             - name: AWS_REGION | ||||
|   | ||||
| @@ -8,3 +8,8 @@ kind: Namespace | ||||
| metadata: | ||||
|   name: {{ .Values.namespaces.cloudwatchNs }} | ||||
| --- | ||||
| apiVersion: v1 | ||||
| kind: Namespace | ||||
| metadata: | ||||
|   name: {{ .Values.namespaces.externaldnsNs }} | ||||
| --- | ||||
|   | ||||
| @@ -5,3 +5,12 @@ metadata: | ||||
|   namespace: {{ .Values.namespaces.nexusNs }} | ||||
|   annotations: | ||||
|     eks.amazonaws.com/role-arn: {{ .Values.serviceAccount.role }} | ||||
| --- | ||||
| apiVersion: v1 | ||||
| kind: ServiceAccount | ||||
| metadata: | ||||
|   name: {{ .Values.serviceAccount.externaldns.name }} | ||||
|   namespace: {{ .Values.namespaces.externaldnsNs }} | ||||
|   annotations: | ||||
|     eks.amazonaws.com/role-arn: {{ .Values.serviceAccount.externaldns.role }} | ||||
| --- | ||||
|   | ||||
| @@ -1,41 +1,49 @@ | ||||
| # Declare variables to be passed into your templates. | ||||
| namespaces: | ||||
|     nexusNs: nexusrepo | ||||
|     cloudwatchNs: amazon-cloudwatch | ||||
|   nexusNs: nexusrepo | ||||
|   cloudwatchNs: amazon-cloudwatch | ||||
|   externaldnsNs: nexus-externaldns | ||||
| externaldns: | ||||
|   domainFilter: example.com #your root domain e.g example.com | ||||
| deployment: | ||||
|    name: nxrm.deployment | ||||
|    clusterName: nxrm-nexus | ||||
|    logsRegion: us-east-1 | ||||
|    initContainer: | ||||
|         image: | ||||
|           repository: busybox | ||||
|           tag: 1.33.1 | ||||
|    container: | ||||
|         image: | ||||
|           repository: sonatype/nexus3 | ||||
|           tag: 3.41.1 | ||||
|         containerPort: 8081 | ||||
|         pullPolicy: IfNotPresent | ||||
|         env: | ||||
|           nexusDBName: nexus | ||||
|           nexusDBPort: 3306 | ||||
|    requestLogContainer: | ||||
|         image: | ||||
|           repository: busybox | ||||
|           tag: 1.33.1 | ||||
|    auditLogContainer: | ||||
|         image: | ||||
|           repository: busybox | ||||
|           tag: 1.33.1 | ||||
|    taskLogContainer: | ||||
|         image: | ||||
|           repository: busybox | ||||
|           tag: 1.33.1 | ||||
|   clusterRegion: us-east-1 | ||||
|   name: nxrm.deployment | ||||
|   clusterName: nxrm-nexus | ||||
|   logsRegion: us-east-1 | ||||
|   fluentBitVersion: 2.28.0 | ||||
|   initContainer: | ||||
|     image: | ||||
|       repository: busybox | ||||
|       tag: 1.33.1 | ||||
|   container: | ||||
|     image: | ||||
|       repository: sonatype/nexus3 | ||||
|       tag: 3.41.1 | ||||
|     containerPort: 8081 | ||||
|     pullPolicy: IfNotPresent | ||||
|     env: | ||||
|       nexusDBName: nexus | ||||
|       nexusDBPort: 3306 | ||||
|   requestLogContainer: | ||||
|     image: | ||||
|       repository: busybox | ||||
|       tag: 1.33.1 | ||||
|   auditLogContainer: | ||||
|     image: | ||||
|       repository: busybox | ||||
|       tag: 1.33.1 | ||||
|   taskLogContainer: | ||||
|     image: | ||||
|       repository: busybox | ||||
|       tag: 1.33.1 | ||||
| serviceAccount: | ||||
|      name: nexus-repository-deployment-sa #This SA is created as part of steps under "AWS Secrets Manager" | ||||
|      role: arn:aws:iam::000000000000:role/nxrm-nexus-role #Role with secretsmanager permissions | ||||
|   name: nexus-repository-deployment-sa #This SA is created as part of steps under "AWS Secrets Manager" | ||||
|   role: arn:aws:iam::000000000000:role/nxrm-nexus-role #Role with secretsmanager permissions | ||||
|   externaldns: | ||||
|     name: external-dns | ||||
|     role: arn:aws:iam::000000000000:role/nexusrepo-external-dns-irsa-role #Role with route53 permissions needed by external-dns      | ||||
| ingress: | ||||
|   #host: "nexus.ingress.rule.host" #host to apply this ingress rule to. Uncomment this in your values.yaml and set it as you wish | ||||
|   #host: "example.com" #host to apply this ingress rule to. Uncomment this in your values.yaml and set it as you wish | ||||
|   annotations: | ||||
|     kubernetes.io/ingress.class: alb | ||||
|     alb.ingress.kubernetes.io/scheme: internal # scheme | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Olu Shiyanbade
					Olu Shiyanbade